src/Entity/GalleryVideo.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\GalleryVideoRepository")
  8.  */
  9. class GalleryVideo
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $galleryTitle;
  21.     /**
  22.      * @ORM\Column(type="date")
  23.      */
  24.     private $dateCreating;
  25.     /**
  26.      * @ORM\Column(type="text")
  27.      */
  28.     private $galleryDescription;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="galleryVideos")
  31.      */
  32.     private $userProperty;
  33.     /**
  34.      * @ORM\ManyToMany(targetEntity="App\Entity\Video", mappedBy="gallery", cascade={"persist"})
  35.      */
  36.     private $videos;
  37.     public function __construct()
  38.     {
  39.         $this->videos = new ArrayCollection();
  40.     }
  41.     
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getGalleryTitle(): ?string
  47.     {
  48.         return $this->galleryTitle;
  49.     }
  50.     public function setGalleryTitle(string $galleryTitle): self
  51.     {
  52.         $this->galleryTitle $galleryTitle;
  53.         return $this;
  54.     }
  55.     public function getDateCreating(): ?\DateTimeInterface
  56.     {
  57.         return $this->dateCreating;
  58.     }
  59.     public function setDateCreating(\DateTimeInterface $dateCreating): self
  60.     {
  61.         $this->dateCreating $dateCreating;
  62.         return $this;
  63.     }
  64.     public function getGalleryDescription(): ?string
  65.     {
  66.         return $this->galleryDescription;
  67.     }
  68.     public function setGalleryDescription(string $galleryDescription): self
  69.     {
  70.         $this->galleryDescription $galleryDescription;
  71.         return $this;
  72.     }
  73.     public function getUserProperty(): ?User
  74.     {
  75.         return $this->userProperty;
  76.     }
  77.     public function setUserProperty(?User $userProperty): self
  78.     {
  79.         $this->userProperty $userProperty;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection|Video[]
  84.      */
  85.     public function getVideos(): Collection
  86.     {
  87.         return $this->videos;
  88.     }
  89.     public function addVideo(Video $video): self
  90.     {
  91.         if (!$this->videos->contains($video)) {
  92.             $this->videos[] = $video;
  93.             $video->addGallery($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeVideo(Video $video): self
  98.     {
  99.         if ($this->videos->contains($video)) {
  100.             $this->videos->removeElement($video);
  101.             $video->removeGallery($this);
  102.         }
  103.         return $this;
  104.     }
  105. }