src/Entity/ResidenceImmeuble.php line 11
<?phpnamespace App\Entity;use App\Repository\ResidenceImmeubleRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ResidenceImmeubleRepository::class)]class ResidenceImmeuble{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 100)]private ?string $code = null;#[ORM\Column(length: 50)]private ?string $libelle = null;#[ORM\OneToMany(mappedBy: 'immeuble', targetEntity: Residence::class)]private Collection $residences;#[ORM\ManyToOne(inversedBy: 'residenceImmeubles')]private ?Entreprise $marchand = null;#[ORM\ManyToOne(inversedBy: 'residenceImmeubles')]private ?Residence $residence = null;#[ORM\OneToMany(mappedBy: 'immeuble', targetEntity: Habitat::class)]private Collection $habitats;public function __construct(){$this->residences = new ArrayCollection();$this->habitats = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getCode(): ?string{return $this->code;}public function setCode(string $code): static{$this->code = $code;return $this;}public function getLibelle(): ?string{return $this->libelle;}public function setLibelle(string $libelle): static{$this->libelle = $libelle;return $this;}/*** @return Collection<int, Residence>*/public function getResidences(): Collection{return $this->residences;}public function addResidence(Residence $residence): static{if (!$this->residences->contains($residence)) {$this->residences->add($residence);$residence->setImmeuble($this);}return $this;}public function removeResidence(Residence $residence): static{if ($this->residences->removeElement($residence)) {// set the owning side to null (unless already changed)if ($residence->getImmeuble() === $this) {$residence->setImmeuble(null);}}return $this;}public function getMarchand(): ?Entreprise{return $this->marchand;}public function setMarchand(?Entreprise $marchand): static{$this->marchand = $marchand;return $this;}public function getResidence(): ?Residence{return $this->residence;}public function setResidence(?Residence $residence): static{$this->residence = $residence;return $this;}/*** @return Collection<int, Habitat>*/public function getHabitats(): Collection{return $this->habitats;}public function addHabitat(Habitat $habitat): static{if (!$this->habitats->contains($habitat)) {$this->habitats->add($habitat);$habitat->setImmeuble($this);}return $this;}public function removeHabitat(Habitat $habitat): static{if ($this->habitats->removeElement($habitat)) {// set the owning side to null (unless already changed)if ($habitat->getImmeuble() === $this) {$habitat->setImmeuble(null);}}return $this;}}