<?php
namespace App\Entity;
use App\Repository\CategorySeanceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CategorySeanceRepository::class)]
class CategorySeance
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $label = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $creationDate = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $modificationDate = null;
#[ORM\OneToMany(mappedBy: 'category', targetEntity: Seance::class)]
private Collection $seances;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $reservationLink = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $presentation = null;
#[ORM\Column(length: 2048, nullable: true)]
private ?string $subtitle = null;
#[ORM\OneToMany(mappedBy: 'categorySeance', targetEntity: Faq::class)]
private Collection $faqs;
#[ORM\Column]
private ?bool $isActive = true;
#[ORM\Column(nullable: true)]
private ?int $ordre = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $miniature = null;
#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]
private array $galleryImages = [];
public function __construct()
{
$this->seances = new ArrayCollection();
$this->faqs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
/**
* toString
* @return string
*/
public function __toString()
{
return $this->getLabel();
}
public function getCreationDate(): ?\DateTimeInterface
{
return $this->creationDate;
}
public function setCreationDate(\DateTimeInterface $creationDate): self
{
$this->creationDate = $creationDate;
return $this;
}
public function getModificationDate(): ?\DateTimeInterface
{
return $this->modificationDate;
}
public function setModificationDate(\DateTimeInterface $modificationDate): self
{
$this->modificationDate = $modificationDate;
return $this;
}
/**
* @return Collection<int, Seance>
*/
public function getSeances(): Collection
{
return $this->seances;
}
public function addSeance(Seance $seance): self
{
if (!$this->seances->contains($seance)) {
$this->seances->add($seance);
$seance->setCategory($this);
}
return $this;
}
public function removeSeance(Seance $seance): self
{
if ($this->seances->removeElement($seance)) {
// set the owning side to null (unless already changed)
if ($seance->getCategory() === $this) {
$seance->setCategory(null);
}
}
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getReservationLink(): ?string
{
return $this->reservationLink;
}
public function setReservationLink(?string $reservationLink): self
{
$this->reservationLink = $reservationLink;
return $this;
}
public function getPresentation(): ?string
{
return $this->presentation;
}
public function setPresentation(?string $presentation): self
{
$this->presentation = $presentation;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
/**
* @return Collection<int, Faq>
*/
public function getFaqs(): Collection
{
return $this->faqs;
}
public function addFaq(Faq $faq): self
{
if (!$this->faqs->contains($faq)) {
$this->faqs->add($faq);
$faq->setCategorySeance($this);
}
return $this;
}
public function removeFaq(Faq $faq): self
{
if ($this->faqs->removeElement($faq)) {
// set the owning side to null (unless already changed)
if ($faq->getCategorySeance() === $this) {
$faq->setCategorySeance(null);
}
}
return $this;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setOrdre(?int $ordre): self
{
$this->ordre = $ordre;
return $this;
}
public function getMiniature(): ?string
{
return $this->miniature;
}
public function setMiniature(?string $miniature): self
{
$this->miniature = $miniature;
return $this;
}
public function getGalleryImages(): array
{
return $this->galleryImages;
}
public function setGalleryImages(?array $galleryImages): self
{
if ($galleryImages == null) {
$this->galleryImages = [];
} else {
$this->galleryImages = $galleryImages;
}
return $this;
}
}