src/Entity/BuildingFolder.php line 14
<?php
namespace App\Entity;
use Symfony\Contracts\Translation\TranslatorInterface;
use App\Repository\BuildingFolderRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\User;
#[ORM\Entity(repositoryClass: BuildingFolderRepository::class)]
class BuildingFolder
{
CONST PROGRESS = "REQUEST_PROGRESS";
CONST INCOMPLETE = "REQUEST_INCOMPLETE";
CONST DECLINED = "REQUEST_DECLINED";
CONST ACCEPTED = "REQUEST_ACCEPTED";
CONST DISABLE = "ROLE_DISABLE";
CONST SIGN_TENANT = "REQUEST_SIGN_TENANT";
CONST SIGN_LESSOR = "REQUEST_SIGN_LESSOR";
CONST SIGN = "REQUEST_SIGN";
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'buildingFolders')]
private ?User $tenant = null;
#[ORM\Column(type: "string", length: 255, nullable: true)]
private ?string $mailContact = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $refusedAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $changeStateAt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $refusedTex = null;
#[ORM\ManyToOne(targetEntity: Building::class, inversedBy: 'buildingFolders')]
private ?Building $building = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $state = null;
#[ORM\ManyToOne(targetEntity: Residence::class, inversedBy: 'buildingFolders')]
private ?Residence $residence = null;
#[ORM\Column(nullable: true)]
private ?bool $isBlockBuilding = null;
#[ORM\Column]
private ?bool $asGarant = false;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lastNameGarant = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $firstNameGarant = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $phoneGarant = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $emailGarant = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $addressGarant = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $incomeGarant = null;
#[ORM\Column(nullable: true)]
private ?bool $isOwnerGarant = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $rentGarant = null;
#[ORM\Column(nullable: true)]
private ?bool $certificatGarantMe = null;
#[ORM\OneToMany(mappedBy: 'buildingFolder', targetEntity: BuildingFolderDocument::class, cascade: ['persist', 'remove'])]
private Collection $buildingFolderDocuments;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $refusedDescription = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $garantMeKey = null;
#[ORM\Column(nullable: true)]
private ?bool $isPaid = null;
#[ORM\Column(nullable: true)]
private ?bool $isPaidTenant = null;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->buildingFolderDocuments = new ArrayCollection();
$this->setState(BuildingFolder::PROGRESS);
}
public function getId(): ?int
{
return $this->id;
}
public function getTenant(): ?User
{
return $this->tenant;
}
public function setTenant(?User $tenant): self
{
$this->tenant = $tenant;
return $this;
}
public function getMailContact(): ?string
{
return $this->mailContact;
}
public function setMailContact(?string $mailContact): self
{
$this->mailContact = $mailContact;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getChangeStateAt(): ?\DateTimeInterface
{
return $this->changeStateAt;
}
public function setChangeStateAt(?\DateTimeInterface $changeStateAt): self
{
$this->changeStateAt = $changeStateAt;
return $this;
}
public function getRefusedAt(): ?\DateTimeInterface
{
return $this->refusedAt;
}
public function setRefusedAt(?\DateTimeInterface $refusedAt): self
{
$this->refusedAt = $refusedAt;
return $this;
}
public function getRefusedTex(): ?string
{
return $this->refusedTex;
}
public function setRefusedTex(?string $refusedTex): self
{
$this->refusedTex = $refusedTex;
return $this;
}
public function getBuilding(): ?Building
{
return $this->building;
}
public function setBuilding(?Building $building): self
{
$this->building = $building;
$this->mailContact = $building->getMailContact();
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
$this->setChangeStateAt(new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris')));
return $this;
}
public function getResidence(): ?Residence
{
return $this->residence;
}
public function setResidence(?Residence $residence): self
{
$this->residence = $residence;
return $this;
}
public function isIsBlockBuilding(): ?bool
{
return $this->isBlockBuilding;
}
public function setIsBlockBuilding(?bool $isBlockBuilding): self
{
$this->isBlockBuilding = $isBlockBuilding;
return $this;
}
public function isAsGarant(): ?bool
{
return $this->asGarant;
}
public function setAsGarant(bool $asGarant): self
{
$this->asGarant = $asGarant;
return $this;
}
public function getLastNameGarant(): ?string
{
return $this->lastNameGarant;
}
public function setLastNameGarant(?string $lastNameGarant): self
{
$this->lastNameGarant = $lastNameGarant;
return $this;
}
public function getFirstNameGarant(): ?string
{
return $this->firstNameGarant;
}
public function setFirstNameGarant(?string $firstNameGarant): self
{
$this->firstNameGarant = $firstNameGarant;
return $this;
}
public function getPhoneGarant(): ?string
{
return $this->phoneGarant;
}
public function setPhoneGarant(?string $phoneGarant): self
{
$this->phoneGarant = $phoneGarant;
return $this;
}
public function getEmailGarant(): ?string
{
return $this->emailGarant;
}
public function setEmailGarant(?string $emailGarant): self
{
$this->emailGarant = $emailGarant;
return $this;
}
public function getAddressGarant(): ?string
{
return $this->addressGarant;
}
public function setAddressGarant(?string $addressGarant): self
{
$this->addressGarant = $addressGarant;
return $this;
}
public function getIncomeGarant(): ?string
{
return $this->incomeGarant;
}
public function setIncomeGarant(?string $incomeGarant): self
{
$this->incomeGarant = $incomeGarant;
return $this;
}
public function isIsOwnerGarant(): ?bool
{
return $this->isOwnerGarant;
}
public function setIsOwnerGarant(?bool $isOwnerGarant): self
{
$this->isOwnerGarant = $isOwnerGarant;
return $this;
}
public function getRentGarant(): ?string
{
return $this->rentGarant;
}
public function setRentGarant(?string $rentGarant): self
{
$this->rentGarant = $rentGarant;
return $this;
}
public function isCertificatGarantMe(): ?bool
{
return $this->certificatGarantMe;
}
public function setCertificatGarantMe(?bool $certificatGarantMe): self
{
$this->certificatGarantMe = $certificatGarantMe;
return $this;
}
/**
* @return Collection<int, BuildingFolderDocument>
*/
public function getBuildingFolderDocuments(): Collection
{
return $this->buildingFolderDocuments;
}
public function addBuildingFolderDocument(BuildingFolderDocument $buildingFolderDocument): self
{
if (!$this->buildingFolderDocuments->contains($buildingFolderDocument)) {
$this->buildingFolderDocuments->add($buildingFolderDocument);
$buildingFolderDocument->setBuildingFolder($this);
}
return $this;
}
public function removeBuildingFolderDocument(BuildingFolderDocument $buildingFolderDocument): self
{
if ($this->buildingFolderDocuments->removeElement($buildingFolderDocument)) {
// set the owning side to null (unless already changed)
if ($buildingFolderDocument->getBuildingFolder() === $this) {
$buildingFolderDocument->setBuildingFolder(null);
}
}
return $this;
}
public function getRefusedDescription(): ?string
{
return $this->refusedDescription;
}
public function setRefusedDescription(?string $refusedDescription): self
{
$this->refusedDescription = $refusedDescription;
return $this;
}
public function getGarantMeKey(): ?string
{
return $this->garantMeKey;
}
public function setGarantMeKey(?string $garantMeKey): self
{
$this->garantMeKey = $garantMeKey;
return $this;
}
public function isIsPaid(): ?bool
{
return $this->isPaid;
}
public function setIsPaid(?bool $isPaid): self
{
$this->isPaid = $isPaid;
return $this;
}
public function isIsPaidTenant(): ?bool
{
return $this->isPaidTenant;
}
public function setIsPaidTenant(?bool $isPaidTenant): self
{
$this->isPaidTenant = $isPaidTenant;
return $this;
}
}