src/Entity/Gallery.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GalleryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassGalleryRepository::class)]
  8. class Gallery
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $title;
  16.     #[ORM\Column(type'text'nullabletrue)]
  17.     private $text;
  18.     #[ORM\Column(type'datetime'nullabletrue)]
  19.     private $created;
  20.     #[ORM\Column(type'datetime'nullabletrue)]
  21.     private $published;
  22.     #[ORM\Column(type'datetime'nullabletrue)]
  23.     private $modified;
  24.     #[ORM\Column(type'boolean'nullabletrue)]
  25.     private $isActive;
  26.     #[ORM\Column(type'string'length255nullabletrue)]
  27.     private $titleTag;
  28.     #[ORM\Column(type'text'nullabletrue)]
  29.     private $metaDescription;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private $keywords;
  32.     #[ORM\Column(type'string'length255nullabletrue)]
  33.     private $image;
  34.     #[ORM\OneToMany(mappedBy'gallery'targetEntityArticle::class)]
  35.     private $articles;
  36.     #[ORM\OneToMany(mappedBy'gallery'targetEntityImage::class)]
  37.     private $images;
  38.     #[ORM\OneToMany(mappedBy'gallery'targetEntityProduct::class)]
  39.     private $products;
  40.     public function __construct()
  41.     {
  42.         $this->articles = new ArrayCollection();
  43.         $this->images = new ArrayCollection();
  44.         $this->products = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getTitle(): ?string
  51.     {
  52.         return $this->title;
  53.     }
  54.     public function setTitle(?string $title): self
  55.     {
  56.         $this->title $title;
  57.         return $this;
  58.     }
  59.     public function getText(): ?string
  60.     {
  61.         return $this->text;
  62.     }
  63.     public function setText(?string $text): self
  64.     {
  65.         $this->text $text;
  66.         return $this;
  67.     }
  68.     public function getCreated(): ?\DateTimeInterface
  69.     {
  70.         return $this->created;
  71.     }
  72.     public function setCreated(?\DateTimeInterface $created): self
  73.     {
  74.         $this->created $created;
  75.         return $this;
  76.     }
  77.     public function getPublished(): ?\DateTimeInterface
  78.     {
  79.         return $this->published;
  80.     }
  81.     public function setPublished(?\DateTimeInterface $published): self
  82.     {
  83.         $this->published $published;
  84.         return $this;
  85.     }
  86.     public function getModified(): ?\DateTimeInterface
  87.     {
  88.         return $this->modified;
  89.     }
  90.     public function setModified(?\DateTimeInterface $modified): self
  91.     {
  92.         $this->modified $modified;
  93.         return $this;
  94.     }
  95.     public function getIsActive(): ?bool
  96.     {
  97.         return $this->isActive;
  98.     }
  99.     public function setIsActive(?bool $isActive): self
  100.     {
  101.         $this->isActive $isActive;
  102.         return $this;
  103.     }
  104.     public function getTitleTag(): ?string
  105.     {
  106.         return $this->titleTag;
  107.     }
  108.     public function setTitleTag(?string $titleTag): self
  109.     {
  110.         $this->titleTag $titleTag;
  111.         return $this;
  112.     }
  113.     public function getMetaDescription(): ?string
  114.     {
  115.         return $this->metaDescription;
  116.     }
  117.     public function setMetaDescription(?string $metaDescription): self
  118.     {
  119.         $this->metaDescription $metaDescription;
  120.         return $this;
  121.     }
  122.     public function getKeywords(): ?string
  123.     {
  124.         return $this->keywords;
  125.     }
  126.     public function setKeywords(?string $keywords): self
  127.     {
  128.         $this->keywords $keywords;
  129.         return $this;
  130.     }
  131.     public function getImage(): ?string
  132.     {
  133.         return $this->image;
  134.     }
  135.     public function setImage(?string $image): self
  136.     {
  137.         $this->image $image;
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return Collection<int, Article>
  142.      */
  143.     public function getArticles(): Collection
  144.     {
  145.         return $this->articles;
  146.     }
  147.     public function addArticle(Article $article): self
  148.     {
  149.         if (!$this->articles->contains($article)) {
  150.             $this->articles[] = $article;
  151.             $article->setGallery($this);
  152.         }
  153.         return $this;
  154.     }
  155.     public function removeArticle(Article $article): self
  156.     {
  157.         if ($this->articles->removeElement($article)) {
  158.             // set the owning side to null (unless already changed)
  159.             if ($article->getGallery() === $this) {
  160.                 $article->setGallery(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return Collection<int, Image>
  167.      */
  168.     public function getImages(): Collection
  169.     {
  170.         return $this->images;
  171.     }
  172.     public function addImage(Image $image): self
  173.     {
  174.         if (!$this->images->contains($image)) {
  175.             $this->images[] = $image;
  176.             $image->setGallery($this);
  177.         }
  178.         return $this;
  179.     }
  180.     public function removeImage(Image $image): self
  181.     {
  182.         if ($this->images->removeElement($image)) {
  183.             // set the owning side to null (unless already changed)
  184.             if ($image->getGallery() === $this) {
  185.                 $image->setGallery(null);
  186.             }
  187.         }
  188.         return $this;
  189.     }
  190.     /**
  191.      * @return Collection<int, Product>
  192.      */
  193.     public function getProducts(): Collection
  194.     {
  195.         return $this->products;
  196.     }
  197.     public function addProduct(Product $product): self
  198.     {
  199.         if (!$this->products->contains($product)) {
  200.             $this->products[] = $product;
  201.             $product->setGallery($this);
  202.         }
  203.         return $this;
  204.     }
  205.     public function removeProduct(Product $product): self
  206.     {
  207.         if ($this->products->removeElement($product)) {
  208.             // set the owning side to null (unless already changed)
  209.             if ($product->getGallery() === $this) {
  210.                 $product->setGallery(null);
  211.             }
  212.         }
  213.         return $this;
  214.     }
  215. }