<?php
namespace App\Entity;
use Symfony\Component\Uid\Uuid;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\CategorieRepository;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=CategorieRepository::class)
* @UniqueEntity(fields={"nom"}, message="Cette catégorie existe déjà")
*/
class Categorie
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $uuid;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $token;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $statut = false;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nom;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $listorder;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $src;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $alt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $title;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $srcImg;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $altImg;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $titleImg;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $intro;
/**
* @ORM\OneToMany(targetEntity=Agora::class, mappedBy="categorie")
*/
private $agoras;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $entite;
public function __construct()
{
$this->uuid = Uuid::v4();
$this->agoras = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(?string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getListorder(): ?int
{
return $this->listorder;
}
public function setListorder(?int $listorder): self
{
$this->listorder = $listorder;
return $this;
}
public function isStatut(): ?bool
{
return $this->statut;
}
public function setStatut(?bool $statut): self
{
$this->statut = $statut;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getSrc(): ?string
{
return $this->src;
}
public function setSrc(?string $src): self
{
$this->src = $src;
return $this;
}
public function getAlt(): ?string
{
return $this->alt;
}
public function setAlt(?string $alt): self
{
$this->alt = $alt;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getSrcImg(): ?string
{
return $this->srcImg;
}
public function setSrcImg(?string $srcImg): self
{
$this->srcImg = $srcImg;
return $this;
}
public function getAltImg(): ?string
{
return $this->altImg;
}
public function setAltImg(?string $altImg): self
{
$this->altImg = $altImg;
return $this;
}
public function getTitleImg(): ?string
{
return $this->titleImg;
}
public function setTitleImg(?string $titleImg): self
{
$this->titleImg = $titleImg;
return $this;
}
public function getIntro(): ?string
{
return $this->intro;
}
public function setIntro(?string $intro): self
{
$this->intro = $intro;
return $this;
}
/**
* @return Collection<int, Agora>
*/
public function getAgoras(): Collection
{
return $this->agoras;
}
public function addAgora(Agora $agora): self
{
if (!$this->agoras->contains($agora)) {
$this->agoras[] = $agora;
$agora->setCategorie($this);
}
return $this;
}
public function removeAgora(Agora $agora): self
{
if ($this->agoras->removeElement($agora)) {
// set the owning side to null (unless already changed)
if ($agora->getCategorie() === $this) {
$agora->setCategorie(null);
}
}
return $this;
}
public function isEntite(): ?bool
{
return $this->entite;
}
public function setEntite(?bool $entite): self
{
$this->entite = $entite;
return $this;
}
}