src/Entity/Image.php line 16

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