src/Entity/Building.php line 13
<?php
namespace App\Entity;
use App\Repository\BuildingRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BuildingRepository::class)]
class Building
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $type = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $borough = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $street = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $streetNumber = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $country = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateStartAt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $status = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $state = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $guaranteeType = null;
#[ORM\Column]
private ?bool $isActive = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $numberId = null;
#[ORM\Column]
private ?int $rent = null;
#[ORM\ManyToOne(inversedBy: 'buildings')]
#[ORM\JoinColumn(nullable: false)]
private ?User $propertyManager = null;
#[ORM\Column(type: Types::TEXT,nullable: true)]
private ?string $description = null;
#[ORM\Column(nullable: true)]
private ?int $leaseTerm = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $editedAt = null;
#[ORM\ManyToOne(inversedBy: 'tenantBuildings')]
private ?User $tenant = null;
#[ORM\OneToMany(mappedBy: 'building', targetEntity: RentalHistory::class, cascade: ['persist', 'remove'])]
private Collection $rentalHistories;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $houseRules = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $contactName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $mailContact = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $phoneContact = null;
#[ORM\Column(nullable: true)]
private ?int $securityDeposit = null;
#[ORM\Column(nullable: true)]
private ?int $expenses = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $expensesDescription = null;
#[ORM\Column(nullable: true)]
private ?int $surface = null;
#[ORM\Column(nullable: true)]
private ?bool $isFurniture = null;
#[ORM\Column(nullable: true)]
private ?bool $isAidEligible = null;
#[ORM\OneToMany(mappedBy: 'building', targetEntity: BuildingEquipment::class, cascade: ['persist', 'remove'])]
private Collection $buildingEquipment;
#[ORM\OneToMany(mappedBy: 'building', targetEntity: BuildingDocument::class, cascade: ['persist', 'remove'])]
private Collection $buildingDocuments;
#[ORM\OneToMany(mappedBy: 'building', targetEntity: BuildingEditHistory::class, cascade: ['persist', 'remove'])]
private Collection $buildingEditHistories;
#[ORM\OneToMany(mappedBy: 'building', targetEntity: BuildingReportingHistory::class, cascade: ['persist', 'remove'])]
private Collection $buildingReportingHistories;
#[ORM\Column(length: 255, nullable: true)]
private ?string $format = null;
#[ORM\ManyToOne(inversedBy: 'buildings')]
private ?City $cityEntity = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $postalCode = null;
#[ORM\OneToMany(mappedBy: 'building', targetEntity: BuildingFolder::class, cascade: ['persist', 'remove'])]
private Collection $buildingFolders;
#[ORM\ManyToOne(inversedBy: 'buildings')]
private ?Residence $residence = null;
#[ORM\Column(nullable: true)]
private ?bool $isBlocked = null;
#[ORM\Column]
private ?bool $isFloor = false;
#[ORM\Column(nullable: true)]
private ?int $floor = null;
#[ORM\ManyToMany(targetEntity: HousingCertificate::class, mappedBy: 'building', cascade: ['persist', 'remove'])]
private Collection $housingCertificates;
#[ORM\Column(length: 255, nullable: true)]
private ?string $PDL = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $wifi = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $DEP = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $GES = null;
#[ORM\Column(nullable: true)]
private ?int $maxFolders = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $uniqueId = null;
#[ORM\OneToMany(mappedBy: 'building', targetEntity: WantedVisio::class, cascade: ['persist', 'remove'])]
private Collection $wantedVisios;
#[ORM\Column(length: 255, nullable: true)]
private ?int $minIncome = null;
#[ORM\Column(nullable: true)]
private ?bool $isEnd = null;
#[ORM\Column(nullable: true)]
private ?float $lat = null;
#[ORM\Column(nullable: true)]
private ?float $lng = null;
#[ORM\Column(nullable: true)]
private ?bool $isAuthorizeAtestation = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $lastAtestation = null;
#[ORM\Column(nullable: true)]
private ?string $hasGuarantor = null;
#[ORM\Column(nullable: false)]
private ?int $timeBail = null;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris'));
$this->editedAt = new \DateTime('now', new \DateTimeZone('Europe/Paris'));
$this->rentalHistories = new ArrayCollection();
$this->buildingEquipment = new ArrayCollection();
$this->buildingDocuments = new ArrayCollection();
$this->buildingEditHistories = new ArrayCollection();
$this->buildingReportingHistories = new ArrayCollection();
$this->buildingFolders = new ArrayCollection();
$this->housingCertificates = new ArrayCollection();
$this->wantedVisios = new ArrayCollection();
$this->setTimeBail(12);
}
public function getTimeBail(): ?int
{
return $this->timeBail;
}
public function setTimeBail(?int $timeBail): self
{
$this->timeBail = $timeBail;
return $this;
}
public function getRefBuilding(): string
{
return "R".$this->getCreatedAt()->format('dmY').$this->getId();
}
public function getLastAtestationt(): ?\DateTimeInterface
{
return $this->lastAtestation;
}
public function setLastAtestation(?\DateTimeInterface $lastAtestation): self
{
$this->lastAtestation = $lastAtestation;
return $this;
}
public function __toString(): string
{
return $this->numberId ?? $this->id;
}
public function isAuthorizeAtestation(): ?bool{
return $this->isAuthorizeAtestation;
}
public function setIsAuthorizeAtestation(?bool $authorizeAtestation): self{
$this->isAuthorizeAtestation =$authorizeAtestation;
return $this;
}
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;
}
public function getBorough(): ?string
{
return $this->borough;
}
public function setBorough(?string $borough): self
{
$this->borough = $borough;
return $this;
}
public function getStreet(): ?string
{
return $this->street;
}
public function setStreet(?string $street): self
{
$this->street = $street;
return $this;
}
public function getStreetNumber(): ?string
{
return $this->streetNumber;
}
public function setStreetNumber(?string $streetNumber): self
{
$this->streetNumber = $streetNumber;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getDateStartAt(): ?\DateTimeInterface
{
return $this->dateStartAt;
}
public function setDateStartAt(?\DateTimeInterface $dateStartAt): self
{
$this->dateStartAt = $dateStartAt;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
return $this;
}
public function getGuaranteeType(): ?string
{
return $this->guaranteeType;
}
public function setGuaranteeType(?string $guaranteeType): self
{
$this->guaranteeType = $guaranteeType;
return $this;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getNumberId(): ?string
{
return $this->numberId;
}
public function setNumberId(string $numberId): self
{
$this->numberId = $numberId;
return $this;
}
public function getRent(): ?int
{
return $this->rent;
}
public function setRent(int $rent): self
{
$this->rent = $rent;
return $this;
}
public function getPropertyManager(): ?User
{
return $this->propertyManager;
}
public function setPropertyManager(?User $propertyManager): self
{
$this->propertyManager = $propertyManager;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getLeaseTerm(): ?int
{
return $this->leaseTerm;
}
public function setLeaseTerm(?int $leaseTerm): self
{
$this->leaseTerm = $leaseTerm;
return $this;
}
public function getEditedAt(): ?\DateTimeInterface
{
return $this->editedAt;
}
public function setEditedAt(\DateTimeInterface $editedAt): self
{
$this->editedAt = $editedAt;
return $this;
}
public function getTenant(): ?User
{
return $this->tenant;
}
public function setTenant(?User $tenant): self
{
$this->tenant = $tenant;
return $this;
}
/**
* @return Collection<int, RentalHistory>
*/
public function getRentalHistories(): Collection
{
return $this->rentalHistories;
}
public function addRentalHistory(RentalHistory $rentalHistory): self
{
if (!$this->rentalHistories->contains($rentalHistory)) {
$this->rentalHistories->add($rentalHistory);
$rentalHistory->setBuilding($this);
}
return $this;
}
public function removeRentalHistory(RentalHistory $rentalHistory): self
{
if ($this->rentalHistories->removeElement($rentalHistory)) {
// set the owning side to null (unless already changed)
if ($rentalHistory->getBuilding() === $this) {
$rentalHistory->setBuilding(null);
}
}
return $this;
}
public function getHouseRules(): ?string
{
return $this->houseRules;
}
public function setHouseRules(?string $houseRules): self
{
$this->houseRules = $houseRules;
return $this;
}
public function getContactName(): ?string
{
return $this->contactName;
}
public function setContactName(?string $contactName): self
{
$this->contactName = $contactName;
return $this;
}
public function getMailContact(): ?string
{
return $this->mailContact;
}
public function setMailContact(?string $mailContact): self
{
$this->mailContact = $mailContact;
return $this;
}
public function getPhoneContact(): ?string
{
return $this->phoneContact;
}
public function setPhoneContact(?string $phoneContact): self
{
$this->phoneContact = $phoneContact;
return $this;
}
public function getSecurityDeposit(): ?int
{
return $this->securityDeposit;
}
public function setSecurityDeposit(?int $securityDeposit): self
{
$this->securityDeposit = $securityDeposit;
return $this;
}
public function getExpenses(): ?int
{
return $this->expenses;
}
public function setExpenses(?int $expenses): self
{
$this->expenses = $expenses;
return $this;
}
public function getExpensesDescription(): ?string
{
return $this->expensesDescription;
}
public function setExpensesDescription(?string $expensesDescription): self
{
$this->expensesDescription = $expensesDescription;
return $this;
}
public function getSurface(): ?int
{
return $this->surface;
}
public function setSurface(?int $surface): self
{
$this->surface = $surface;
return $this;
}
public function isIsFurniture(): ?bool
{
return $this->isFurniture;
}
public function setIsFurniture(?bool $isFurniture): self
{
$this->isFurniture = $isFurniture;
return $this;
}
public function isIsAidEligible(): ?bool
{
return $this->isAidEligible;
}
public function setIsAidEligible(?bool $isAidEligible): self
{
$this->isAidEligible = $isAidEligible;
return $this;
}
/**
* @return Collection<int, BuildingEquipment>
*/
public function getBuildingEquipment(): Collection
{
return $this->buildingEquipment;
}
public function addBuildingEquipment(BuildingEquipment $buildingEquipment): self
{
if (!$this->buildingEquipment->contains($buildingEquipment)) {
$this->buildingEquipment->add($buildingEquipment);
$buildingEquipment->setBuilding($this);
}
return $this;
}
public function removeBuildingEquipment(BuildingEquipment $buildingEquipment): self
{
if ($this->buildingEquipment->removeElement($buildingEquipment)) {
// set the owning side to null (unless already changed)
if ($buildingEquipment->getBuilding() === $this) {
$buildingEquipment->setBuilding(null);
}
}
return $this;
}
/**
* @return Collection<int, BuildingDocument>
*/
public function getBuildingDocuments(): Collection
{
return $this->buildingDocuments;
}
public function addBuildingDocument(BuildingDocument $buildingDocument): self
{
if (!$this->buildingDocuments->contains($buildingDocument)) {
$this->buildingDocuments->add($buildingDocument);
$buildingDocument->setBuilding($this);
}
return $this;
}
public function removeBuildingDocument(BuildingDocument $buildingDocument): self
{
if ($this->buildingDocuments->removeElement($buildingDocument)) {
// set the owning side to null (unless already changed)
if ($buildingDocument->getBuilding() === $this) {
$buildingDocument->setBuilding(null);
}
}
return $this;
}
/**
* @return Collection<int, BuildingEditHistory>
*/
public function getBuildingEditHistories(): Collection
{
return $this->buildingEditHistories;
}
public function addBuildingEditHistory(BuildingEditHistory $buildingEditHistory): self
{
if (!$this->buildingEditHistories->contains($buildingEditHistory)) {
$this->buildingEditHistories->add($buildingEditHistory);
$buildingEditHistory->setBuilding($this);
}
return $this;
}
public function removeBuildingEditHistory(BuildingEditHistory $buildingEditHistory): self
{
if ($this->buildingEditHistories->removeElement($buildingEditHistory)) {
// set the owning side to null (unless already changed)
if ($buildingEditHistory->getBuilding() === $this) {
$buildingEditHistory->setBuilding(null);
}
}
return $this;
}
/**
* @return Collection<int, BuildingReportingHistory>
*/
public function getBuildingReportingHistories(): Collection
{
return $this->buildingReportingHistories;
}
public function addBuildingReportingHistory(BuildingReportingHistory $buildingReportingHistory): self
{
if (!$this->buildingReportingHistories->contains($buildingReportingHistory)) {
$this->buildingReportingHistories->add($buildingReportingHistory);
$buildingReportingHistory->setBuilding($this);
}
return $this;
}
public function removeBuildingReportingHistory(BuildingReportingHistory $buildingReportingHistory): self
{
if ($this->buildingReportingHistories->removeElement($buildingReportingHistory)) {
// set the owning side to null (unless already changed)
if ($buildingReportingHistory->getBuilding() === $this) {
$buildingReportingHistory->setBuilding(null);
}
}
return $this;
}
public function getFormat(): ?string
{
return $this->format;
}
public function setFormat(?string $format): self
{
$this->format = $format;
return $this;
}
public function getCityEntity(): ?City
{
return $this->cityEntity;
}
public function setCityEntity(?City $cityEntity): self
{
$this->cityEntity = $cityEntity;
return $this;
}
public function getPostalCode(): ?string
{
return $this->postalCode;
}
public function setPostalCode(?string $postalCode): self
{
$this->postalCode = $postalCode;
return $this;
}
/**
* @return Collection<int, BuildingFolder>
*/
public function getBuildingFolders(): Collection
{
return $this->buildingFolders;
}
public function addBuildingFolder(BuildingFolder $buildingFolder): self
{
if (!$this->buildingFolders->contains($buildingFolder)) {
$this->buildingFolders->add($buildingFolder);
$buildingFolder->setBuilding($this);
}
return $this;
}
public function removeBuildingFolder(BuildingFolder $buildingFolder): self
{
if ($this->buildingFolders->removeElement($buildingFolder)) {
// set the owning side to null (unless already changed)
if ($buildingFolder->getBuilding() === $this) {
$buildingFolder->setBuilding(null);
}
}
return $this;
}
public function getResidence(): ?Residence
{
return $this->residence;
}
public function setResidence(?Residence $residence): self
{
$this->residence = $residence;
return $this;
}
public function isIsBlocked(): ?bool
{
return $this->isBlocked;
}
public function setIsBlocked(?bool $isBlocked): self
{
$this->isBlocked = $isBlocked;
return $this;
}
public function isIsFloor(): ?bool
{
return $this->isFloor;
}
public function setIsFloor(bool $isFloor): self
{
$this->isFloor = $isFloor;
return $this;
}
public function getFloor(): ?int
{
return $this->floor;
}
public function setFloor(?int $floor): self
{
$this->floor = $floor;
return $this;
}
/**
* @return Collection<int, HousingCertificate>
*/
public function getHousingCertificates(): Collection
{
return $this->housingCertificates;
}
public function addHousingCertificate(HousingCertificate $housingCertificate): self
{
if (!$this->housingCertificates->contains($housingCertificate)) {
$this->housingCertificates->add($housingCertificate);
$housingCertificate->addBuilding($this);
}
return $this;
}
public function removeHousingCertificate(HousingCertificate $housingCertificate): self
{
if ($this->housingCertificates->removeElement($housingCertificate)) {
$housingCertificate->removeBuilding($this);
}
return $this;
}
public function getPDL(): ?string
{
return $this->PDL;
}
public function setPDL(?string $PDL): self
{
$this->PDL = $PDL;
return $this;
}
public function getWifi(): ?string
{
return $this->wifi;
}
public function setWifi(?string $wifi): self
{
$this->wifi = $wifi;
return $this;
}
public function getDEP(): ?string
{
return $this->DEP;
}
public function setDEP(?string $DEP): self
{
$this->DEP = $DEP;
return $this;
}
public function getGES(): ?string
{
return $this->GES;
}
public function setGES(?string $GES): self
{
$this->GES = $GES;
return $this;
}
public function getMaxFolders(): ?int
{
return $this->maxFolders;
}
public function setMaxFolders(?int $maxFolders): self
{
$this->maxFolders = $maxFolders;
return $this;
}
public function getUniqueId(): ?string
{
return $this->uniqueId;
}
public function setUniqueId(?string $uniqueId): self
{
$this->uniqueId = $uniqueId;
return $this;
}
/**
* @return Collection<int, WantedVisio>
*/
public function getWantedVisios(): Collection
{
return $this->wantedVisios;
}
public function addWantedVisio(WantedVisio $wantedVisio): self
{
if (!$this->wantedVisios->contains($wantedVisio)) {
$this->wantedVisios->add($wantedVisio);
$wantedVisio->setBuilding($this);
}
return $this;
}
public function removeWantedVisio(WantedVisio $wantedVisio): self
{
if ($this->wantedVisios->removeElement($wantedVisio)) {
// set the owning side to null (unless already changed)
if ($wantedVisio->getBuilding() === $this) {
$wantedVisio->setBuilding(null);
}
}
return $this;
}
public function getMinIncome(): ?int
{
return $this->minIncome;
}
public function setMinIncome(?int $minIncome): void
{
$this->minIncome = $minIncome;
}
public function getHasGuarantor(): ?string
{
return $this->hasGuarantor;
}
public function setHasGuarantor(?string $hasGuarantor): void
{
$this->hasGuarantor = $hasGuarantor;
}
public function isIsEnd(): ?bool
{
return $this->isEnd;
}
public function setIsEnd(?bool $isEnd): self
{
$this->isEnd = $isEnd;
return $this;
}
public function getLat(): ?float
{
return $this->lat;
}
public function setLat(?float $lat): self
{
$this->lat = $lat;
return $this;
}
public function getLng(): ?float
{
return $this->lng;
}
public function setLng(?float $lng): self
{
$this->lng = $lng;
return $this;
}
}