src/Entity/POIContent.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\POIContentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use JMS\Serializer\Annotation as Serializer;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use Symfony\Component\HttpFoundation\File\File;
  11. #[ORM\Entity(repositoryClassPOIContentRepository::class)]
  12. #[Vich\Uploadable]
  13. class POIContent
  14. {
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  20.     #[Serializer\Groups(["poi"])]
  21.     private array $type = [];
  22.     #[ORM\Column(length2048nullabletrue)]
  23.     #[Serializer\Groups(["poi"])]
  24.     private ?string $text null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     #[Serializer\Groups(["poi"])]
  27.     #[Serializer\SerializedName("audioTextUrl")]
  28.     private ?string $audio_text_url null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     #[Serializer\Groups(["poi"])]
  31.     #[Serializer\SerializedName("videoUrl")]
  32.     private ?string $video_url null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     #[Serializer\Groups(["poi"])]
  35.     #[Serializer\SerializedName("imageUrl")]
  36.     private ?string $image_url null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     #[Serializer\Groups(["poi"])]
  39.     #[Serializer\SerializedName("audioUrl")]
  40.     private ?string $audio_url null;
  41.     #[ORM\ManyToMany(targetEntityPOI::class, inversedBy'poicontents')]
  42.     #[Serializer\Groups(["poi"])]
  43.     private Collection $pois;
  44.     #[Vich\UploadableField(mapping'thumbnails'fileNameProperty'image_url')]
  45.     #[Serializer\Groups(["poi"])]
  46.     #[Serializer\SerializedName("imageFile")]
  47.     private ?File $imageFile null;
  48.     #[Vich\UploadableField(mapping'thumbnails'fileNameProperty'video_url')]
  49.     #[Serializer\Groups(["poi"])]
  50.     #[Serializer\SerializedName("videoFile")]
  51.     private ?File $videoFile null;
  52.     #[Vich\UploadableField(mapping'thumbnails'fileNameProperty'audio_url')]
  53.     #[Serializer\Groups(["poi"])]
  54.     #[Serializer\SerializedName("audioFile")]
  55.     private ?File $audioFile null;
  56.     public function __construct()
  57.     {
  58.         $this->pois = new ArrayCollection();
  59.         $this->pOIs = new ArrayCollection();
  60.     }
  61.     public function setImageFile(?File $imageFile null): void
  62.     {
  63.         $this->imageFile $imageFile;
  64.  
  65.         if (null !== $imageFile) {
  66.             // It is required that at least one field changes if you are using doctrine
  67.             // otherwise the event listeners won't be called and the file is lost
  68.         }
  69.     }
  70.     public function getImageFile(): ?File
  71.     {
  72.         return $this->imageFile;
  73.     }
  74.     public function setVideoFile(?File $videoFile null): void
  75.     {
  76.         $this->videoFile $videoFile;
  77.  
  78.         if (null !== $videoFile) {
  79.             // It is required that at least one field changes if you are using doctrine
  80.             // otherwise the event listeners won't be called and the file is lost
  81.         }
  82.     }
  83.     public function getVideoFile(): ?File
  84.     {
  85.         return $this->videoFile;
  86.     }
  87.     public function getAudioFile(): ?File
  88.     {
  89.         return $this->audioFile;
  90.     }
  91.     public function setAudioFile(?File $audioFile null): void
  92.     {
  93.         $this->audioFile $audioFile;
  94.  
  95.         if (null !== $audioFile) {
  96.             // It is required that at least one field changes if you are using doctrine
  97.             // otherwise the event listeners won't be called and the file is lost
  98.         }
  99.     }
  100.     public function getId(): ?int
  101.     {
  102.         return $this->id;
  103.     }
  104.     public function getType(): array
  105.     {
  106.         return $this->type;
  107.     }
  108.     public function setType(?array $type): self
  109.     {
  110.         $this->type $type;
  111.         return $this;
  112.     }
  113.     public function getText(): ?string
  114.     {
  115.         return $this->text;
  116.     }
  117.     public function setText(?string $text): self
  118.     {
  119.         $this->text $text;
  120.         return $this;
  121.     }
  122.     public function getAudioTextUrl(): ?string
  123.     {
  124.         return $this->audio_text_url;
  125.     }
  126.     public function setAudioTextUrl(?string $audio_text_url): self
  127.     {
  128.         $this->audio_text_url $audio_text_url;
  129.         return $this;
  130.     }
  131.     public function getVideoUrl(): ?string
  132.     {
  133.         return $this->video_url;
  134.     }
  135.     public function setVideoUrl(string $video_url): self
  136.     {
  137.         $this->video_url $video_url;
  138.         return $this;
  139.     }
  140.     public function getImageUrl(): ?string
  141.     {
  142.         return $this->image_url;
  143.     }
  144.     public function setImageUrl(string $image_url): self
  145.     {
  146.         $this->image_url $image_url;
  147.         return $this;
  148.     }
  149.     public function getAudioUrl(): ?string
  150.     {
  151.         return $this->audio_url;
  152.     }
  153.     public function setAudioUrl(string $audio_url): self
  154.     {
  155.         $this->audio_url $audio_url;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, POI>
  160.      */
  161.     public function getPois(): Collection
  162.     {
  163.         return $this->pois;
  164.     }
  165.     public function addPoi(POI $poi): self
  166.     {
  167.         if (!$this->pois->contains($poi)) {
  168.             $this->pois->add($poi);
  169.         }
  170.         return $this;
  171.     }
  172.     public function removePoi(POI $poi): self
  173.     {
  174.         $this->pois->removeElement($poi);
  175.         return $this;
  176.     }
  177. }