src/Entity/Gallery/Gallery.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gallery;
  3. use App\Repository\Gallery\GalleryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassGalleryRepository::class)]
  9. class Gallery
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $name null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $created_at null;
  19.     #[ORM\ManyToMany(targetEntityCollectionGallery::class, mappedBy'gallery'cascade: ['persist'])]
  20.     private Collection $collectionGalleries;
  21.     #[ORM\Column(length350nullabletrue)]
  22.     private ?string $content null;
  23.     #[ORM\Column(length250nullabletrue)]
  24.     private ?string $mentions null;
  25.     #[ORM\ManyToMany(targetEntityGalleryCategory::class, mappedBy'Gallery'cascade: ['persist'])]
  26.     private Collection $galleryCategories;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $keywords null;
  29.     public function __construct()
  30.     {
  31.         $this->collectionGalleries = new ArrayCollection();
  32.         $this->galleryCategories = new ArrayCollection();
  33.     }
  34.     public function __toString()
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getName(): ?string
  43.     {
  44.         return $this->name;
  45.     }
  46.     public function setName(string $name): self
  47.     {
  48.         $this->name $name;
  49.         return $this;
  50.     }
  51.     public function getCreatedAt(): ?\DateTimeInterface
  52.     {
  53.         return $this->created_at;
  54.     }
  55.     public function setCreatedAt(\DateTimeInterface $created_at): self
  56.     {
  57.         $this->created_at $created_at;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection<int, CollectionGallery>
  62.      */
  63.     public function getCollectionGalleries(): Collection
  64.     {
  65.         return $this->collectionGalleries;
  66.     }
  67.     public function addCollectionGallery(CollectionGallery $collectionGallery): self
  68.     {
  69.         if (!$this->collectionGalleries->contains($collectionGallery)) {
  70.             $this->collectionGalleries->add($collectionGallery);
  71.             $collectionGallery->addGallery($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeCollectionGallery(CollectionGallery $collectionGallery): self
  76.     {
  77.         if ($this->collectionGalleries->removeElement($collectionGallery)) {
  78.             $collectionGallery->removeGallery($this);
  79.         }
  80.         return $this;
  81.     }
  82.     public function getContent(): ?string
  83.     {
  84.         return $this->content;
  85.     }
  86.     public function setContent(?string $content): self
  87.     {
  88.         $this->content $content;
  89.         return $this;
  90.     }
  91.     public function getMentions(): ?string
  92.     {
  93.         return $this->mentions;
  94.     }
  95.     public function setMentions(?string $mentions): self
  96.     {
  97.         $this->mentions $mentions;
  98.         return $this;
  99.     }
  100.     /**
  101.      * @return Collection<int, GalleryCategory>
  102.      */
  103.     public function getGalleryCategories(): Collection
  104.     {
  105.         return $this->galleryCategories;
  106.     }
  107.     public function addGalleryCategory(GalleryCategory $galleryCategory): self
  108.     {
  109.         if (!$this->galleryCategories->contains($galleryCategory)) {
  110.             $this->galleryCategories->add($galleryCategory);
  111.             $galleryCategory->addGallery($this);
  112.         }
  113.         return $this;
  114.     }
  115.     public function removeGalleryCategory(GalleryCategory $galleryCategory): self
  116.     {
  117.         if ($this->galleryCategories->removeElement($galleryCategory)) {
  118.             $galleryCategory->removeGallery($this);
  119.         }
  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. }