src/Entity/Actuv2InfographieRseCarouselMobileFile.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\Actuv2InfographieRseCarouselMobileFileRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. /**
  8.  * @Vich\Uploadable
  9.  */
  10. #[ORM\Entity(repositoryClassActuv2InfographieRseCarouselMobileFileRepository::class)]
  11. class Actuv2InfographieRseCarouselMobileFile
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     #[ORM\Column(type'string'length255nullabletrue)]
  18.     private ?string $fileName null;
  19.     /**
  20.      * @Vich\UploadableField(mapping="actuv2_infographie_rse_file", fileNameProperty="fileName")
  21.      * @var File
  22.      */
  23.     private $file;
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private ?string $fileNameWebp null;
  26.     /**
  27.      * @Vich\UploadableField(mapping="actuv2_infographie_rse_file", fileNameProperty="fileNameWebp")
  28.      * @var File
  29.      */
  30.     private $fileWebp;
  31.     #[ORM\ManyToOne(targetEntityActuv2InfographieRse::class, inversedBy'actuv2InfographieRseCarouselMobileFiles')]
  32.     private $actuv2InfographieRse;
  33.     #[ORM\Column(type'datetime')]
  34.     private $updatedAt;
  35.     #[ORM\Column(type'integer'options: ["default" => 0])]
  36.     private $orderDisplay;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getFileNameWebp(): ?string
  42.     {
  43.         return $this->fileNameWebp;
  44.     }
  45.     public function setFileNameWebp(?string $fileNameWebp): self
  46.     {
  47.         $this->fileNameWebp $fileNameWebp;
  48.         return $this;
  49.     }
  50.     public function setFileWebp(?File $fileWebp null)
  51.     {
  52.         $this->fileWebp $fileWebp;
  53.         // VERY IMPORTANT:
  54.         // It is required that at least one field changes if you are using Doctrine,
  55.         // otherwise the event listeners won't be called and the file is lost
  56.         if ($fileWebp) {
  57.             // if 'updatedAt' is not defined in your entity, use another property
  58.             $this->updatedAt = new \DateTime('now');
  59.         }
  60.     }
  61.     public function getFileWebp()
  62.     {
  63.         return $this->fileWebp;
  64.     }
  65.     public function getFileName(): ?string
  66.     {
  67.         return $this->fileName;
  68.     }
  69.     public function setFileName(?string $fileName): self
  70.     {
  71.         $this->fileName $fileName;
  72.         return $this;
  73.     }
  74.     public function setFile(?File $file null)
  75.     {
  76.         $this->file $file;
  77.         // VERY IMPORTANT:
  78.         // It is required that at least one field changes if you are using Doctrine,
  79.         // otherwise the event listeners won't be called and the file is lost
  80.         if ($file) {
  81.             // if 'updatedAt' is not defined in your entity, use another property
  82.             $this->updatedAt = new \DateTime('now');
  83.         }
  84.     }
  85.     public function getFile()
  86.     {
  87.         return $this->file;
  88.     }
  89.     public function getActuv2InfographieRse(): ?Actuv2InfographieRse
  90.     {
  91.         return $this->actuv2InfographieRse;
  92.     }
  93.     public function setActuv2InfographieRse(?Actuv2InfographieRse $actuv2InfographieRse): self
  94.     {
  95.         $this->actuv2InfographieRse $actuv2InfographieRse;
  96.         return $this;
  97.     }
  98.     public function getUpdatedAt(): ?\DateTimeInterface
  99.     {
  100.         return $this->updatedAt;
  101.     }
  102.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  103.     {
  104.         $this->updatedAt $updatedAt;
  105.         return $this;
  106.     }
  107.     public function getOrderDisplay(): ?int
  108.     {
  109.         return $this->orderDisplay;
  110.     }
  111.     public function setOrderDisplay(int $orderDisplay): self
  112.     {
  113.         $this->orderDisplay $orderDisplay;
  114.         return $this;
  115.     }
  116. }