<?php
namespace App\Entity;
use App\Repository\CguRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CguRepository::class)
*/
class Cgu
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $titre;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $contenue;
/**
* @ORM\ManyToOne(targetEntity=TypeGuide::class, inversedBy="cgus")
*/
private $cgutype;
/**
* @ORM\ManyToOne(targetEntity=Cgu::class, inversedBy="cgus")
*/
private $superieur_id;
/**
* @ORM\OneToMany(targetEntity=Cgu::class, mappedBy="superieur_id")
*/
private $cgus;
public function __construct()
{
$this->cgus = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
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;
}
public function getCgutype(): ?TypeGuide
{
return $this->cgutype;
}
public function setCgutype(?TypeGuide $cgutype): self
{
$this->cgutype = $cgutype;
return $this;
}
public function getSuperieurId(): ?self
{
return $this->superieur_id;
}
public function setSuperieurId(?self $superieur_id): self
{
$this->superieur_id = $superieur_id;
return $this;
}
/**
* @return Collection<int, self>
*/
public function getCgus(): Collection
{
return $this->cgus;
}
public function addCgu(self $cgu): self
{
if (!$this->cgus->contains($cgu)) {
$this->cgus[] = $cgu;
$cgu->setSuperieurId($this);
}
return $this;
}
public function removeCgu(self $cgu): self
{
if ($this->cgus->removeElement($cgu)) {
// set the owning side to null (unless already changed)
if ($cgu->getSuperieurId() === $this) {
$cgu->setSuperieurId(null);
}
}
return $this;
}
}