<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;/** * @ORM\Entity(repositoryClass="App\Repository\GalleryPhotoRepository") */class GalleryPhoto{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") * @Groups("galleryPhoto") */ private $id; /** * @ORM\Column(type="string", length=255) * @Groups("galleryPhoto") */ private $galleryTitle; /** * @ORM\Column(type="date") * @Groups("galleryPhoto") */ private $dateCreating; /** * @ORM\Column(type="string", length=255) * @Groups("galleryPhoto") */ private $galleryDescription; /** * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="galleryPhotos") */ private $userProperty; /** * @ORM\ManyToMany(targetEntity="App\Entity\Photo", mappedBy="gallery", cascade={"persist"}) * @Groups("galleryPhoto") */ private $photos; /** * @ORM\Column(type="json", nullable=true) */ private $selectHeaderSlide = []; public function __construct() { $this->photos = 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|Photo[] */ public function getPhotos(): Collection { return $this->photos; } public function addPhoto(Photo $photo): self { if (!$this->photos->contains($photo)) { $this->photos[] = $photo; $photo->addGallery($this); } return $this; } public function removePhoto(Photo $photo): self { if ($this->photos->contains($photo)) { $this->photos->removeElement($photo); $photo->removeGallery($this); } return $this; } public function getSelectHeaderSlide(): ?array { return $this->selectHeaderSlide; } public function setSelectHeaderSlide(?array $selectHeaderSlide): self { $this->selectHeaderSlide = $selectHeaderSlide; return $this; }}