<?phpnamespace App\Entity;use App\Repository\CgvRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CgvRepository::class) */class Cgv{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=TypeGuide::class, inversedBy="cgvs") * @ORM\JoinColumn(nullable=false) */ private $cgvtype; /** * @ORM\ManyToOne(targetEntity=Cgv::class, inversedBy="cgvs") */ private $superieur; /** * @ORM\OneToMany(targetEntity=Cgv::class, mappedBy="superieur") */ private $cgvs; /** * @ORM\Column(type="string", length=255) */ private $titre; /** * @ORM\Column(type="text") */ private $contenue; public function __construct() { $this->cgvs = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getCgvtype(): ?TypeGuide { return $this->cgvtype; } public function setCgvtype(?TypeGuide $cgvtype): self { $this->cgvtype = $cgvtype; return $this; } public function getSuperieur(): ?self { return $this->superieur; } public function setSuperieur(?self $superieur): self { $this->superieur = $superieur; return $this; } /** * @return Collection<int, self> */ public function getCgvs(): Collection { return $this->cgvs; } public function addCgv(self $cgv): self { if (!$this->cgvs->contains($cgv)) { $this->cgvs[] = $cgv; $cgv->setSuperieur($this); } return $this; } public function removeCgv(self $cgv): self { if ($this->cgvs->removeElement($cgv)) { // set the owning side to null (unless already changed) if ($cgv->getSuperieur() === $this) { $cgv->setSuperieur(null); } } return $this; } public function getTitre(): ?string { return $this->titre; } public function setTitre(string $titre): self { $this->titre = $titre; return $this; } public function getContenue(): ?string { return $this->contenue; } public function setContenue(string $contenue): self { $this->contenue = $contenue; return $this; }}