src/Entity/CareNetwork.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\HttpFoundation\File\File;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use DateTime;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\CareNetworkRepository")
  10.  * @Vich\Uploadable
  11.  */
  12. class CareNetwork
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $slug;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $logoPath;
  32.     /**
  33.      * @assert\File( mimeTypes = {"image/jpeg", "image/png", "image/gif", "image/jpg"})
  34.      * @Vich\UploadableField(mapping="brand_logo", fileNameProperty="logoPath")
  35.      * @var File
  36.      */
  37.     private $logoFile;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      */
  41.     private $updatedAt;
  42.     /**
  43.      * @ORM\Column(type="text", nullable=true)
  44.      */
  45.     private $wording;
  46.     public function __construct()
  47.     {
  48.     }
  49.     /**
  50.      * @return mixed
  51.      */
  52.     public function getUpdatedAt(): ?\DateTimeInterface
  53.     {
  54.         return $this->updatedAt;
  55.     }
  56.     /**
  57.      * @param mixed $updatedAt
  58.      */
  59.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  60.     {
  61.         $this->updatedAt $updatedAt;
  62.         return $this;
  63.     }
  64.     public function getLogoPath(): ?string
  65.     {
  66.         return $this->logoPath;
  67.     }
  68.     public function setLogoPath(string $logoPath): self
  69.     {
  70.         $this->logoPath $logoPath;
  71.         return $this;
  72.     }
  73.     public function hasLogo()
  74.     {
  75.         return !is_null($this->logoPath);
  76.     }
  77.     public function getLogoFile()
  78.     {
  79.         return $this->logoFile;
  80.     }
  81.     public function setLogoFile(File $logoPath null)
  82.     {
  83.         $this->logoFile $logoPath;
  84.         if ($logoPath) {
  85.             $this->updatedAt = new \DateTime('now');
  86.         }
  87.     }
  88.     public function getId(): ?int
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getName(): ?string
  93.     {
  94.         return $this->name;
  95.     }
  96.     public function setName(string $name): self
  97.     {
  98.         $this->name $name;
  99.         return $this;
  100.     }
  101.     public function getSlug(): ?string
  102.     {
  103.         return $this->slug;
  104.     }
  105.     public function setSlug(string $slug): self
  106.     {
  107.         $this->slug $slug;
  108.         return $this;
  109.     }
  110.     public function getWording(): ?string
  111.     {
  112.         return $this->wording;
  113.     }
  114.     public function setWording(?string $wording): self
  115.     {
  116.         $this->wording $wording;
  117.         return $this;
  118.     }
  119. }