<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\GalleryVideoRepository") */class GalleryVideo{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $galleryTitle; /** * @ORM\Column(type="date") */ private $dateCreating; /** * @ORM\Column(type="text") */ private $galleryDescription; /** * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="galleryVideos") */ private $userProperty; /** * @ORM\ManyToMany(targetEntity="App\Entity\Video", mappedBy="gallery", cascade={"persist"}) */ private $videos; public function __construct() { $this->videos = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getGalleryTitle(): ?string { return $this->galleryTitle; } public function setGalleryTitle(string $galleryTitle): self { $this->galleryTitle = $galleryTitle; return $this; } public function getDateCreating(): ?\DateTimeInterface { return $this->dateCreating; } public function setDateCreating(\DateTimeInterface $dateCreating): self { $this->dateCreating = $dateCreating; return $this; } public function getGalleryDescription(): ?string { return $this->galleryDescription; } public function setGalleryDescription(string $galleryDescription): self { $this->galleryDescription = $galleryDescription; return $this; } public function getUserProperty(): ?User { return $this->userProperty; } public function setUserProperty(?User $userProperty): self { $this->userProperty = $userProperty; return $this; } /** * @return Collection|Video[] */ public function getVideos(): Collection { return $this->videos; } public function addVideo(Video $video): self { if (!$this->videos->contains($video)) { $this->videos[] = $video; $video->addGallery($this); } return $this; } public function removeVideo(Video $video): self { if ($this->videos->contains($video)) { $this->videos->removeElement($video); $video->removeGallery($this); } return $this; }}