src/Entity/Cgv.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CgvRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CgvRepository::class)
  9.  */
  10. class Cgv
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=TypeGuide::class, inversedBy="cgvs")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $cgvtype;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Cgv::class, inversedBy="cgvs")
  25.      */
  26.     private $superieur;
  27.     /**
  28.      * @ORM\OneToMany(targetEntity=Cgv::class, mappedBy="superieur")
  29.      */
  30.     private $cgvs;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      */
  34.     private $titre;
  35.     /**
  36.      * @ORM\Column(type="text")
  37.      */
  38.     private $contenue;
  39.     public function __construct()
  40.     {
  41.         $this->cgvs = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getCgvtype(): ?TypeGuide
  48.     {
  49.         return $this->cgvtype;
  50.     }
  51.     public function setCgvtype(?TypeGuide $cgvtype): self
  52.     {
  53.         $this->cgvtype $cgvtype;
  54.         return $this;
  55.     }
  56.     public function getSuperieur(): ?self
  57.     {
  58.         return $this->superieur;
  59.     }
  60.     public function setSuperieur(?self $superieur): self
  61.     {
  62.         $this->superieur $superieur;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @return Collection<int, self>
  67.      */
  68.     public function getCgvs(): Collection
  69.     {
  70.         return $this->cgvs;
  71.     }
  72.     public function addCgv(self $cgv): self
  73.     {
  74.         if (!$this->cgvs->contains($cgv)) {
  75.             $this->cgvs[] = $cgv;
  76.             $cgv->setSuperieur($this);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeCgv(self $cgv): self
  81.     {
  82.         if ($this->cgvs->removeElement($cgv)) {
  83.             // set the owning side to null (unless already changed)
  84.             if ($cgv->getSuperieur() === $this) {
  85.                 $cgv->setSuperieur(null);
  86.             }
  87.         }
  88.         return $this;
  89.     }
  90.     public function getTitre(): ?string
  91.     {
  92.         return $this->titre;
  93.     }
  94.     public function setTitre(string $titre): self
  95.     {
  96.         $this->titre $titre;
  97.         return $this;
  98.     }
  99.     public function getContenue(): ?string
  100.     {
  101.         return $this->contenue;
  102.     }
  103.     public function setContenue(string $contenue): self
  104.     {
  105.         $this->contenue $contenue;
  106.         return $this;
  107.     }
  108. }