src/Entity/DevisCategorie.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DevisCategorieRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDevisCategorieRepository::class)]
  8. class DevisCategorie
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length500nullabletrue)]
  15.     private ?string $nom null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $reference null;
  18.     #[ORM\Column(nullabletrue)]
  19.     private ?bool $statut null;
  20.     #[ORM\OneToMany(targetEntityDevisSection::class, mappedBy'categorie')]
  21.     private Collection $devisSections;
  22.     public function __construct()
  23.     {
  24.         $this->devisSections = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getNom(): ?string
  31.     {
  32.         return $this->nom;
  33.     }
  34.     public function setNom(?string $nom): static
  35.     {
  36.         $this->nom $nom;
  37.         return $this;
  38.     }
  39.     public function getReference(): ?string
  40.     {
  41.         return $this->reference;
  42.     }
  43.     public function setReference(?string $reference): static
  44.     {
  45.         $this->reference $reference;
  46.         return $this;
  47.     }
  48.     public function isStatut(): ?bool
  49.     {
  50.         return $this->statut;
  51.     }
  52.     public function setStatut(?bool $statut): static
  53.     {
  54.         $this->statut $statut;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, DevisSection>
  59.      */
  60.     public function getDevisSections(): Collection
  61.     {
  62.         return $this->devisSections;
  63.     }
  64.     public function addDevisSection(DevisSection $devisSection): static
  65.     {
  66.         if (!$this->devisSections->contains($devisSection)) {
  67.             $this->devisSections->add($devisSection);
  68.             $devisSection->setCategorie($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeDevisSection(DevisSection $devisSection): static
  73.     {
  74.         if ($this->devisSections->removeElement($devisSection)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($devisSection->getCategorie() === $this) {
  77.                 $devisSection->setCategorie(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }