src/Entity/PageService.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PageServiceRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. /** @Vich\Uploadable
  8.  */
  9. #[ORM\Entity(repositoryClassPageServiceRepository::class)]
  10. class PageService
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type'integer')]
  15.     private $id;
  16.     #[ORM\Column(type'text'nullabletrue)]
  17.     private $titre;
  18.     #[ORM\Column(type'text'nullabletrue)]
  19.     private $description;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private $logo;
  22.     #[ORM\ManyToOne(targetEntitySeoPage::class, inversedBy'pageServices')]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     private $seopage;
  25.      /**
  26.      * @Vich\UploadableField(mapping="services_logos", fileNameProperty="logo")
  27.      * @var File|null
  28.      */
  29.     private $tmpLogo null;
  30.     #[ORM\Column(type'datetime'nullabletrue)]
  31.     private $updatedAt;
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getTitre(): ?string
  37.     {
  38.         return $this->titre;
  39.     }
  40.     public function setTitre(?string $titre): self
  41.     {
  42.         $this->titre $titre;
  43.         return $this;
  44.     }
  45.     public function getDescription(): ?string
  46.     {
  47.         return $this->description;
  48.     }
  49.     public function setDescription(string $description): self
  50.     {
  51.         $this->description $description;
  52.         return $this;
  53.     }
  54.     public function getLogo(): ?string
  55.     {
  56.         return $this->logo;
  57.     }
  58.     public function setLogo(?string $logo): self
  59.     {
  60.         $this->logo $logo;
  61.         return $this;
  62.     }
  63.     public function getSeopage(): ?SeoPage
  64.     {
  65.         return $this->seopage;
  66.     }
  67.     public function setSeopage(?SeoPage $seopage): self
  68.     {
  69.         $this->seopage $seopage;
  70.         return $this;
  71.     }
  72.       public function setTmpLogo(?File $tmpLogo null): void
  73.     {
  74.         $this->tmpLogo $tmpLogo;
  75.         if($tmpLogo)
  76.         $this->updatedAt = new \DateTime('now');
  77.     }
  78.     public function getTmpLogo() : ?File
  79.     {
  80.         return $this->tmpLogo;
  81.     }
  82.     public function getUpdatedAt(): ?\DateTimeInterface
  83.     {
  84.         return $this->updatedAt;
  85.     }
  86.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  87.     {
  88.         $this->updatedAt $updatedAt;
  89.         return $this;
  90.     }
  91. }