<?phpnamespace App\Entity\Gallery;use App\Repository\Gallery\GalleryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: GalleryRepository::class)]class Gallery{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $created_at = null; #[ORM\ManyToMany(targetEntity: CollectionGallery::class, mappedBy: 'gallery', cascade: ['persist'])] private Collection $collectionGalleries; #[ORM\Column(length: 350, nullable: true)] private ?string $content = null; #[ORM\Column(length: 250, nullable: true)] private ?string $mentions = null; #[ORM\ManyToMany(targetEntity: GalleryCategory::class, mappedBy: 'Gallery', cascade: ['persist'])] private Collection $galleryCategories; #[ORM\Column(length: 255, nullable: true)] private ?string $keywords = null; public function __construct() { $this->collectionGalleries = new ArrayCollection(); $this->galleryCategories = new ArrayCollection(); } public function __toString() { return $this->name; } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->created_at; } public function setCreatedAt(\DateTimeInterface $created_at): self { $this->created_at = $created_at; return $this; } /** * @return Collection<int, CollectionGallery> */ public function getCollectionGalleries(): Collection { return $this->collectionGalleries; } public function addCollectionGallery(CollectionGallery $collectionGallery): self { if (!$this->collectionGalleries->contains($collectionGallery)) { $this->collectionGalleries->add($collectionGallery); $collectionGallery->addGallery($this); } return $this; } public function removeCollectionGallery(CollectionGallery $collectionGallery): self { if ($this->collectionGalleries->removeElement($collectionGallery)) { $collectionGallery->removeGallery($this); } return $this; } public function getContent(): ?string { return $this->content; } public function setContent(?string $content): self { $this->content = $content; return $this; } public function getMentions(): ?string { return $this->mentions; } public function setMentions(?string $mentions): self { $this->mentions = $mentions; return $this; } /** * @return Collection<int, GalleryCategory> */ public function getGalleryCategories(): Collection { return $this->galleryCategories; } public function addGalleryCategory(GalleryCategory $galleryCategory): self { if (!$this->galleryCategories->contains($galleryCategory)) { $this->galleryCategories->add($galleryCategory); $galleryCategory->addGallery($this); } return $this; } public function removeGalleryCategory(GalleryCategory $galleryCategory): self { if ($this->galleryCategories->removeElement($galleryCategory)) { $galleryCategory->removeGallery($this); } return $this; } public function getKeywords(): ?string { return $this->keywords; } public function setKeywords(?string $keywords): self { $this->keywords = $keywords; return $this; }}