src/Entity/Societe.php line 11
<?phpnamespace App\Entity;use App\Repository\SocieteRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: SocieteRepository::class)]class Societe{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 50)]private ?string $name = null;#[ORM\Column(length: 25)]private ?string $phone = null;#[ORM\Column(length: 50, nullable: true)]private ?string $email = null;#[ORM\Column(length: 255, nullable: true)]private ?string $adress = null;#[ORM\ManyToMany(targetEntity: Locataire::class, mappedBy: 'society')]private Collection $locataires;public function __construct(){$this->locataires = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(string $phone): static{$this->phone = $phone;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(?string $email): static{$this->email = $email;return $this;}public function getAdress(): ?string{return $this->adress;}public function setAdress(?string $adress): static{$this->adress = $adress;return $this;}/*** @return Collection<int, Locataire>*/public function getLocataires(): Collection{return $this->locataires;}public function addLocataire(Locataire $locataire): static{if (!$this->locataires->contains($locataire)) {$this->locataires->add($locataire);$locataire->addSociety($this);}return $this;}public function removeLocataire(Locataire $locataire): static{if ($this->locataires->removeElement($locataire)) {$locataire->removeSociety($this);}return $this;}}