src/Entity/Document.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImageRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @Vich\Uploadable
  10.  */
  11. #[ORM\Entity(repositoryClassImageRepository::class)]
  12. class Document
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $name;
  20.     /**
  21.      * @Vich\UploadableField(mapping="documents", fileNameProperty="name")
  22.      */
  23.     private $tmpName;
  24.     #[ORM\Column(type'datetime')]
  25.     private $updatedAt;
  26.     #[ORM\ManyToOne(targetEntityEbook::class, inversedBy'documents')]
  27.     private $ebook;
  28.     #[ORM\ManyToOne(targetEntityWebsiteNews::class, inversedBy'documents')]
  29.     private $websiteNews;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private $title;
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(?string $name): self
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getTmpName(): ?File
  46.     {
  47.         return $this->tmpName;
  48.     }
  49.     public function setTmpName(?File $tmpName null): self
  50.     {
  51.         $this->tmpName $tmpName;
  52.         $this->updatedAt = new \DateTime('now');
  53.         return $this;
  54.     }
  55.     public function getUpdatedAt(): ?\DateTimeInterface
  56.     {
  57.         return $this->updatedAt;
  58.     }
  59.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  60.     {
  61.         $this->updatedAt $updatedAt;
  62.         return $this;
  63.     }
  64.     public function getEbook(): ?Ebook
  65.     {
  66.         return $this->ebook;
  67.     }
  68.     public function setEbook(?Ebook $ebook): self
  69.     {
  70.         $this->ebook $ebook;
  71.         return $this;
  72.     }
  73.     public function getWebsiteNews(): ?WebsiteNews
  74.     {
  75.         return $this->websiteNews;
  76.     }
  77.     public function setWebsiteNews(?WebsiteNews $websiteNews): self
  78.     {
  79.         $this->websiteNews $websiteNews;
  80.         return $this;
  81.     }
  82.     public function getTitle(): ?string
  83.     {
  84.         return $this->title;
  85.     }
  86.     public function setTitle(?string $title): self
  87.     {
  88.         $this->title $title;
  89.         return $this;
  90.     }
  91. }