<?phpnamespace App\Entity;use App\Repository\BailleurRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: BailleurRepository::class)]class Bailleur{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $type = null; #[ORM\OneToMany(mappedBy: 'bailleurid', targetEntity: PersonnePhysique::class)] private Collection $personnePhysiques; #[ORM\OneToMany(mappedBy: 'bailleurid', targetEntity: Societe::class)] private Collection $societes; #[ORM\Column(length: 255)] private ?string $nom = null; public function __construct() { $this->personnePhysiques = new ArrayCollection(); $this->societes = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getType(): ?string { return $this->type; } public function setType(string $type): self { $this->type = $type; return $this; } /** * @return Collection<int, PersonnePhysique> */ public function getPersonnePhysiques(): Collection { return $this->personnePhysiques; } public function addPersonnePhysique(PersonnePhysique $personnePhysique): self { if (!$this->personnePhysiques->contains($personnePhysique)) { $this->personnePhysiques->add($personnePhysique); $personnePhysique->setBailleurid($this); } return $this; } public function removePersonnePhysique(PersonnePhysique $personnePhysique): self { if ($this->personnePhysiques->removeElement($personnePhysique)) { // set the owning side to null (unless already changed) if ($personnePhysique->getBailleurid() === $this) { $personnePhysique->setBailleurid(null); } } return $this; } /** * @return Collection<int, Societe> */ public function getSocietes(): Collection { return $this->societes; } public function addSociete(Societe $societe): self { if (!$this->societes->contains($societe)) { $this->societes->add($societe); $societe->setBailleurid($this); } return $this; } public function removeSociete(Societe $societe): self { if ($this->societes->removeElement($societe)) { // set the owning side to null (unless already changed) if ($societe->getBailleurid() === $this) { $societe->setBailleurid(null); } } return $this; } public function getNom(): ?string { return $this->nom; } public function setNom(string $nom): self { $this->nom = $nom; return $this; }}