src/Entity/Rubrique.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RubriqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassRubriqueRepository::class)]
  8. class Rubrique
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $label null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $titre null;
  18.     #[ORM\Column]
  19.     private ?bool $param_commun true;
  20.     #[ORM\Column]
  21.     private ?bool $param_option false;
  22.     #[ORM\Column]
  23.     private ?bool $param_sur_mesure true;
  24.     #[ORM\Column]
  25.     private ?bool $actif true;
  26.     #[ORM\Column]
  27.     private ?int $ordre null;
  28.     #[ORM\ManyToOne(inversedBy'rubriques')]
  29.     private ?Section $section null;
  30.     #[ORM\OneToMany(mappedBy'rubrique'targetEntityElement::class , cascade: ['remove''persist'])]
  31.     private Collection $elements;
  32.     public function __construct()
  33.     {
  34.         $this->elements = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getLabel(): ?string
  41.     {
  42.         return $this->label;
  43.     }
  44.     public function setLabel(string $label): static
  45.     {
  46.         $this->label $label;
  47.         return $this;
  48.     }
  49.     public function getTitre(): ?string
  50.     {
  51.         return $this->titre;
  52.     }
  53.     public function setTitre(string $titre): static
  54.     {
  55.         $this->titre $titre;
  56.         return $this;
  57.     }
  58.     public function isParamCommun(): ?bool
  59.     {
  60.         return $this->param_commun;
  61.     }
  62.     public function setParamCommun(bool $param_commun): static
  63.     {
  64.         $this->param_commun $param_commun;
  65.         return $this;
  66.     }
  67.     public function isParamOption(): ?bool
  68.     {
  69.         return $this->param_option;
  70.     }
  71.     public function setParamOption(bool $param_option): static
  72.     {
  73.         $this->param_option $param_option;
  74.         return $this;
  75.     }
  76.     public function isParamSurMesure(): ?bool
  77.     {
  78.         return $this->param_sur_mesure;
  79.     }
  80.     public function setParamSurMesure(bool $param_sur_mesure): static
  81.     {
  82.         $this->param_sur_mesure $param_sur_mesure;
  83.         return $this;
  84.     }
  85.     public function isActif(): ?bool
  86.     {
  87.         return $this->actif;
  88.     }
  89.     public function setActif(bool $actif): static
  90.     {
  91.         $this->actif $actif;
  92.         return $this;
  93.     }
  94.     public function getOrdre(): ?int
  95.     {
  96.         return $this->ordre;
  97.     }
  98.     public function setOrdre(int $ordre): static
  99.     {
  100.         $this->ordre $ordre;
  101.         return $this;
  102.     }
  103.     public function getSection(): ?Section
  104.     {
  105.         return $this->section;
  106.     }
  107.     public function setSection(?Section $section): static
  108.     {
  109.         $this->section $section;
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return Collection<int, Element>
  114.      */
  115.     public function getElements(): Collection
  116.     {
  117.         return $this->elements;
  118.     }
  119.     public function addElement(Element $element): static
  120.     {
  121.         if (!$this->elements->contains($element)) {
  122.             $this->elements->add($element);
  123.             $element->setRubrique($this);
  124.         }
  125.         return $this;
  126.     }
  127.     public function removeElement(Element $element): static
  128.     {
  129.         if ($this->elements->removeElement($element)) {
  130.             // set the owning side to null (unless already changed)
  131.             if ($element->getRubrique() === $this) {
  132.                 $element->setRubrique(null);
  133.             }
  134.         }
  135.         return $this;
  136.     }
  137. }