src/Entity/Gallery.php line 11
<?php
namespace App\Entity;
use App\Repository\GalleryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: GalleryRepository::class)]
class Gallery
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $title;
#[ORM\Column(type: 'text', nullable: true)]
private $text;
#[ORM\Column(type: 'datetime', nullable: true)]
private $created;
#[ORM\Column(type: 'datetime', nullable: true)]
private $published;
#[ORM\Column(type: 'datetime', nullable: true)]
private $modified;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isActive;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $titleTag;
#[ORM\Column(type: 'text', nullable: true)]
private $metaDescription;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $keywords;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $image;
#[ORM\OneToMany(mappedBy: 'gallery', targetEntity: Article::class)]
private $articles;
#[ORM\OneToMany(mappedBy: 'gallery', targetEntity: Image::class)]
private $images;
#[ORM\OneToMany(mappedBy: 'gallery', targetEntity: Product::class)]
private $products;
public function __construct()
{
$this->articles = new ArrayCollection();
$this->images = new ArrayCollection();
$this->products = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getText(): ?string
{
return $this->text;
}
public function setText(?string $text): self
{
$this->text = $text;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(?\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getPublished(): ?\DateTimeInterface
{
return $this->published;
}
public function setPublished(?\DateTimeInterface $published): self
{
$this->published = $published;
return $this;
}
public function getModified(): ?\DateTimeInterface
{
return $this->modified;
}
public function setModified(?\DateTimeInterface $modified): self
{
$this->modified = $modified;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getTitleTag(): ?string
{
return $this->titleTag;
}
public function setTitleTag(?string $titleTag): self
{
$this->titleTag = $titleTag;
return $this;
}
public function getMetaDescription(): ?string
{
return $this->metaDescription;
}
public function setMetaDescription(?string $metaDescription): self
{
$this->metaDescription = $metaDescription;
return $this;
}
public function getKeywords(): ?string
{
return $this->keywords;
}
public function setKeywords(?string $keywords): self
{
$this->keywords = $keywords;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
/**
* @return Collection<int, Article>
*/
public function getArticles(): Collection
{
return $this->articles;
}
public function addArticle(Article $article): self
{
if (!$this->articles->contains($article)) {
$this->articles[] = $article;
$article->setGallery($this);
}
return $this;
}
public function removeArticle(Article $article): self
{
if ($this->articles->removeElement($article)) {
// set the owning side to null (unless already changed)
if ($article->getGallery() === $this) {
$article->setGallery(null);
}
}
return $this;
}
/**
* @return Collection<int, Image>
*/
public function getImages(): Collection
{
return $this->images;
}
public function addImage(Image $image): self
{
if (!$this->images->contains($image)) {
$this->images[] = $image;
$image->setGallery($this);
}
return $this;
}
public function removeImage(Image $image): self
{
if ($this->images->removeElement($image)) {
// set the owning side to null (unless already changed)
if ($image->getGallery() === $this) {
$image->setGallery(null);
}
}
return $this;
}
/**
* @return Collection<int, Product>
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): self
{
if (!$this->products->contains($product)) {
$this->products[] = $product;
$product->setGallery($this);
}
return $this;
}
public function removeProduct(Product $product): self
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getGallery() === $this) {
$product->setGallery(null);
}
}
return $this;
}
}