<?phpnamespace App\Entity;use App\Repository\RubriqueRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Doctrine\DBAL\Types\Types;#[ORM\Entity(repositoryClass: RubriqueRepository::class)]class Rubrique{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255)] private $libelle;// #[ORM\Column(type: Types::TEXT, length: 10000, nullable: true)]// private $description; #[ORM\ManyToOne(inversedBy: 'rubriques')] #[ORM\JoinColumn(nullable: false)] private ?Service $service = null; #[ORM\Column] private ?bool $isShowable = null; #[ORM\OneToMany(mappedBy: 'rubrique', targetEntity: Prestation::class, orphanRemoval: true, cascade: ['persist', 'remove'] )] private Collection $prestations; public function __construct() { $this->axe = new ArrayCollection(); $this->prestations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLibelle(): ?string { return $this->libelle; } public function setLibelle(string $libelle): self { $this->libelle = $libelle; return $this; }// public function getDescription(): ?string// {// return $this->description;// }//// public function setDescription(string $description): self// {// $this->description = $description;//// return $this;// } public function getService(): ?Service { return $this->service; } public function setService(?Service $service): self { $this->service = $service; return $this; } public function isIsShowable(): ?bool { return $this->isShowable; } public function setIsShowable(bool $isShowable): self { $this->isShowable = $isShowable; return $this; } /** * @return Collection<int, Prestation> */ public function getPrestations(): Collection { return $this->prestations; } public function addPrestation(Prestation $prestation): self { if (!$this->prestations->contains($prestation)) { $this->prestations->add($prestation); $prestation->setRubrique($this); } return $this; } public function removePrestation(Prestation $prestation): self { if ($this->prestations->removeElement($prestation)) { // set the owning side to null (unless already changed) if ($prestation->getRubrique() === $this) { $prestation->setRubrique(null); } } return $this; } public function __toString() { return $this->libelle; }}