src/Entity/Divers.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DiversRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDiversRepository::class)]
  8. class Divers
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nom null;
  16.     #[ORM\OneToMany(mappedBy'divers'targetEntityFacture::class)]
  17.     private Collection $factures;
  18.     #[ORM\ManyToOne]
  19.     private ?SystemeClient $systemeClient null;
  20.     public function __construct()
  21.     {
  22.         $this->factures = 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.     /**
  38.      * @return Collection<int, Facture>
  39.      */
  40.     public function getFactures(): Collection
  41.     {
  42.         return $this->factures;
  43.     }
  44.     public function addFacture(Facture $facture): static
  45.     {
  46.         if (!$this->factures->contains($facture)) {
  47.             $this->factures->add($facture);
  48.             $facture->setDivers($this);
  49.         }
  50.         return $this;
  51.     }
  52.     public function removeFacture(Facture $facture): static
  53.     {
  54.         if ($this->factures->removeElement($facture)) {
  55.             // set the owning side to null (unless already changed)
  56.             if ($facture->getDivers() === $this) {
  57.                 $facture->setDivers(null);
  58.             }
  59.         }
  60.         return $this;
  61.     }
  62.     public function __toString()
  63.     {
  64.         return $this->getNom();
  65.     }
  66.     public function getSystemeClient(): ?SystemeClient
  67.     {
  68.         return $this->systemeClient;
  69.     }
  70.     public function setSystemeClient(?SystemeClient $systemeClient): static
  71.     {
  72.         $this->systemeClient $systemeClient;
  73.         return $this;
  74.     }
  75. }