src/Entity/Categorie.php line 13
<?phpnamespace App\Entity;use App\Entity\Traits\Timestamp;use App\Repository\CategorieRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CategorieRepository::class)]#[ORM\HasLifecycleCallbacks]class Categorie{use Timestamp;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]private ?string $slug = null;#[ORM\OneToMany(mappedBy: 'categorie', targetEntity: Projet::class)]private Collection $projets;public function __construct(){$this->projets = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getSlug(): ?string{return $this->slug;}public function setSlug(string $slug): static{$this->slug = $slug;return $this;}/*** @return Collection<int, Projet>*/public function getProjets(): Collection{return $this->projets;}public function addProjet(Projet $projet): self{if (!$this->projets->contains($projet)) {$this->projets->add($projet);$projet->setCategorie($this);}return $this;}public function removeProjet(Projet $projet): self{if ($this->projets->removeElement($projet)) {// set the owning side to null (unless already changed)if ($projet->getCategorie() === $this) {$projet->setCategorie(null);}}return $this;}public function __toString(){return $this->getName();}}