src/Entity/DevisTarif.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DevisTarifRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDevisTarifRepository::class)]
  8. class DevisTarif
  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\OneToMany(targetEntityDevisSousSection::class, mappedBy'tarif')]
  19.     private Collection $devisSousSections;
  20.     public function __construct()
  21.     {
  22.         $this->devisSousSections = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getNom(): ?string
  29.     {
  30.         return $this->nom;
  31.     }
  32.     public function setNom(?string $nom): static
  33.     {
  34.         $this->nom $nom;
  35.         return $this;
  36.     }
  37.     public function getReference(): ?string
  38.     {
  39.         return $this->reference;
  40.     }
  41.     public function setReference(?string $reference): static
  42.     {
  43.         $this->reference $reference;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return Collection<int, DevisSousSection>
  48.      */
  49.     public function getDevisSousSections(): Collection
  50.     {
  51.         return $this->devisSousSections;
  52.     }
  53.     public function addDevisSousSection(DevisSousSection $devisSousSection): static
  54.     {
  55.         if (!$this->devisSousSections->contains($devisSousSection)) {
  56.             $this->devisSousSections->add($devisSousSection);
  57.             $devisSousSection->setTarif($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeDevisSousSection(DevisSousSection $devisSousSection): static
  62.     {
  63.         if ($this->devisSousSections->removeElement($devisSousSection)) {
  64.             // set the owning side to null (unless already changed)
  65.             if ($devisSousSection->getTarif() === $this) {
  66.                 $devisSousSection->setTarif(null);
  67.             }
  68.         }
  69.         return $this;
  70.     }
  71. }