<?phpnamespace App\Entity;use Symfony\Component\HttpFoundation\File\File;use Doctrine\ORM\Mapping as ORM;use DateTime;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass="App\Repository\CareNetworkRepository") * @Vich\Uploadable */class CareNetwork{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $slug; /** * @ORM\Column(type="string", length=255) */ private $logoPath; /** * @assert\File( mimeTypes = {"image/jpeg", "image/png", "image/gif", "image/jpg"}) * @Vich\UploadableField(mapping="brand_logo", fileNameProperty="logoPath") * @var File */ private $logoFile; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\Column(type="text", nullable=true) */ private $wording; public function __construct() { } /** * @return mixed */ public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } /** * @param mixed $updatedAt */ public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getLogoPath(): ?string { return $this->logoPath; } public function setLogoPath(string $logoPath): self { $this->logoPath = $logoPath; return $this; } public function hasLogo() { return !is_null($this->logoPath); } public function getLogoFile() { return $this->logoFile; } public function setLogoFile(File $logoPath = null) { $this->logoFile = $logoPath; if ($logoPath) { $this->updatedAt = new \DateTime('now'); } } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } public function getWording(): ?string { return $this->wording; } public function setWording(?string $wording): self { $this->wording = $wording; return $this; }}