src/Entity/PodcastPrivateGlobal.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PodcastPrivateGlobalRepository;
  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(repositoryClassPodcastPrivateGlobalRepository::class)]
  11. class PodcastPrivateGlobal
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     // NOTE: This is not a mapped field of entity metadata, just a simple property.
  18.     /**
  19.      * @Vich\UploadableField(mapping="podcast_middle_file", fileNameProperty="voiceOffIntroFilename")
  20.      * @var File|null
  21.      */
  22.     private ?File $voiceOffIntroFile null;
  23.     #[ORM\Column(nullabletrue)]
  24.     private ?string $voiceOffIntroFilename null;
  25.     // NOTE: This is not a mapped field of entity metadata, just a simple property.
  26.     /**
  27.      * @Vich\UploadableField(mapping="podcast_middle_file", fileNameProperty="introFilename")
  28.      * @var File|null
  29.      */
  30.     private ?File $introFile null;
  31.     #[ORM\Column(nullabletrue)]
  32.     private ?string $introFilename null;
  33.     // NOTE: This is not a mapped field of entity metadata, just a simple property.
  34.     /**
  35.      * @Vich\UploadableField(mapping="podcast_middle_file", fileNameProperty="outroCommuneFilename")
  36.      * @var File|null
  37.      */
  38.     private ?File $outroCommuneFile null;
  39.     #[ORM\Column(nullabletrue)]
  40.     private ?string $outroCommuneFilename null;
  41.     #[ORM\Column(type'datetime_immutable')]
  42.     private $updateAt;
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     /**
  48.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  49.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  50.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  51.      * must be able to accept an instance of 'File' as the bundle will inject one here
  52.      * during Doctrine hydration.
  53.      *
  54.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  55.      */
  56.     public function setVoiceOffIntroFile(?File $voiceOffIntroFile null): void
  57.     {
  58.         $this->voiceOffIntroFile $voiceOffIntroFile;
  59.         if (null !== $voiceOffIntroFile) {
  60.             // It is required that at least one field changes if you are using doctrine
  61.             // otherwise the event listeners won't be called and the file is lost
  62.             $this->updateAt = new \DateTimeImmutable();
  63.         }
  64.     }
  65.     public function getVoiceOffIntroFile(): ?File
  66.     {
  67.         return $this->voiceOffIntroFile;
  68.     }
  69.     public function setVoiceOffIntroFileName(?string $voiceOffIntroFilename): void
  70.     {
  71.         $this->voiceOffIntroFilename $voiceOffIntroFilename;
  72.     }
  73.     public function getVoiceOffIntroFileName(): ?string
  74.     {
  75.         return $this->voiceOffIntroFilename;
  76.     }
  77.     /**
  78.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  79.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  80.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  81.      * must be able to accept an instance of 'File' as the bundle will inject one here
  82.      * during Doctrine hydration.
  83.      *
  84.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  85.      */
  86.     public function setIntroFile(?File $introFile null): void
  87.     {
  88.         $this->introFile $introFile;
  89.         if (null !== $introFile) {
  90.             // It is required that at least one field changes if you are using doctrine
  91.             // otherwise the event listeners won't be called and the file is lost
  92.             $this->updateAt = new \DateTimeImmutable();
  93.         }
  94.     }
  95.     public function getIntroFile(): ?File
  96.     {
  97.         return $this->introFile;
  98.     }
  99.     public function setIntroFileName(?string $introFilename): void
  100.     {
  101.         $this->introFilename $introFilename;
  102.     }
  103.     public function getIntroFileName(): ?string
  104.     {
  105.         return $this->introFilename;
  106.     }
  107.     /**
  108.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  109.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  110.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  111.      * must be able to accept an instance of 'File' as the bundle will inject one here
  112.      * during Doctrine hydration.
  113.      *
  114.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  115.      */
  116.     public function setOutroCommuneFile(?File $outroCommuneFile null): void
  117.     {
  118.         $this->outroCommuneFile $outroCommuneFile;
  119.         if (null !== $outroCommuneFile) {
  120.             // It is required that at least one field changes if you are using doctrine
  121.             // otherwise the event listeners won't be called and the file is lost
  122.             $this->updateAt = new \DateTimeImmutable();
  123.         }
  124.     }
  125.     public function getOutroCommuneFile(): ?File
  126.     {
  127.         return $this->outroCommuneFile;
  128.     }
  129.     public function setOutroCommuneFileName(?string $outroCommuneFilename): void
  130.     {
  131.         $this->outroCommuneFilename $outroCommuneFilename;
  132.     }
  133.     public function getOutroCommuneFileName(): ?string
  134.     {
  135.         return $this->outroCommuneFilename;
  136.     }
  137.     public function getUpdateAt(): ?\DateTimeImmutable
  138.     {
  139.         return $this->updateAt;
  140.     }
  141.     public function setUpdateAt(\DateTimeImmutable $updateAt): self
  142.     {
  143.         $this->updateAt $updateAt;
  144.         return $this;
  145.     }
  146. }