src/Entity/Bailleur.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BailleurRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassBailleurRepository::class)]
  8. class Bailleur
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $type null;
  16.     #[ORM\OneToMany(mappedBy'bailleurid'targetEntityPersonnePhysique::class)]
  17.     private Collection $personnePhysiques;
  18.     #[ORM\OneToMany(mappedBy'bailleurid'targetEntitySociete::class)]
  19.     private Collection $societes;
  20.     #[ORM\Column(length255)]
  21.     private ?string $nom null;
  22.     public function __construct()
  23.     {
  24.         $this->personnePhysiques = new ArrayCollection();
  25.         $this->societes = new ArrayCollection();
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getType(): ?string
  32.     {
  33.         return $this->type;
  34.     }
  35.     public function setType(string $type): self
  36.     {
  37.         $this->type $type;
  38.         return $this;
  39.     }
  40.     /**
  41.      * @return Collection<int, PersonnePhysique>
  42.      */
  43.     public function getPersonnePhysiques(): Collection
  44.     {
  45.         return $this->personnePhysiques;
  46.     }
  47.     public function addPersonnePhysique(PersonnePhysique $personnePhysique): self
  48.     {
  49.         if (!$this->personnePhysiques->contains($personnePhysique)) {
  50.             $this->personnePhysiques->add($personnePhysique);
  51.             $personnePhysique->setBailleurid($this);
  52.         }
  53.         return $this;
  54.     }
  55.     public function removePersonnePhysique(PersonnePhysique $personnePhysique): self
  56.     {
  57.         if ($this->personnePhysiques->removeElement($personnePhysique)) {
  58.             // set the owning side to null (unless already changed)
  59.             if ($personnePhysique->getBailleurid() === $this) {
  60.                 $personnePhysique->setBailleurid(null);
  61.             }
  62.         }
  63.         return $this;
  64.     }
  65.     /**
  66.      * @return Collection<int, Societe>
  67.      */
  68.     public function getSocietes(): Collection
  69.     {
  70.         return $this->societes;
  71.     }
  72.     public function addSociete(Societe $societe): self
  73.     {
  74.         if (!$this->societes->contains($societe)) {
  75.             $this->societes->add($societe);
  76.             $societe->setBailleurid($this);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeSociete(Societe $societe): self
  81.     {
  82.         if ($this->societes->removeElement($societe)) {
  83.             // set the owning side to null (unless already changed)
  84.             if ($societe->getBailleurid() === $this) {
  85.                 $societe->setBailleurid(null);
  86.             }
  87.         }
  88.         return $this;
  89.     }
  90.     public function getNom(): ?string
  91.     {
  92.         return $this->nom;
  93.     }
  94.     public function setNom(string $nom): self
  95.     {
  96.         $this->nom $nom;
  97.         return $this;
  98.     }
  99. }