src/Entity/BuildingFolder.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Contracts\Translation\TranslatorInterface;
  4. use App\Repository\BuildingFolderRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use App\Entity\User;
  10. #[ORM\Entity(repositoryClassBuildingFolderRepository::class)]
  11. class BuildingFolder
  12. {
  13.     
  14.     CONST PROGRESS "REQUEST_PROGRESS";
  15.     CONST INCOMPLETE "REQUEST_INCOMPLETE";
  16.     CONST DECLINED "REQUEST_DECLINED";
  17.     CONST ACCEPTED "REQUEST_ACCEPTED";
  18.     CONST DISABLE "ROLE_DISABLE";
  19.     CONST SIGN_TENANT "REQUEST_SIGN_TENANT";
  20.     CONST SIGN_LESSOR "REQUEST_SIGN_LESSOR";
  21.     CONST SIGN "REQUEST_SIGN";
  22.     #[ORM\Id]
  23.     #[ORM\GeneratedValue]
  24.     #[ORM\Column]
  25.     private ?int $id null;
  26.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'buildingFolders')]
  27.     private ?User $tenant null;
  28.     #[ORM\Column(type"string"length255nullabletrue)]
  29.    private ?string $mailContact null;
  30.     
  31.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  32.     private ?\DateTimeInterface $createdAt null;
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  34.     private ?\DateTimeInterface $refusedAt null;
  35.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  36.     private ?\DateTimeInterface $changeStateAt null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $refusedTex null;
  39.     #[ORM\ManyToOne(targetEntityBuilding::class, inversedBy'buildingFolders')]
  40.     private ?Building $building null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $state null;
  43.     #[ORM\ManyToOne(targetEntityResidence::class, inversedBy'buildingFolders')]
  44.     private ?Residence $residence null;
  45.     #[ORM\Column(nullabletrue)]
  46.     private ?bool $isBlockBuilding null;
  47.     #[ORM\Column]
  48.     private ?bool $asGarant false;
  49.     #[ORM\Column(length255nullabletrue)]
  50.     private ?string $lastNameGarant null;
  51.     #[ORM\Column(length255nullabletrue)]
  52.     private ?string $firstNameGarant null;
  53.     #[ORM\Column(length255nullabletrue)]
  54.     private ?string $phoneGarant null;
  55.     #[ORM\Column(length255nullabletrue)]
  56.     private ?string $emailGarant null;
  57.     #[ORM\Column(length255nullabletrue)]
  58.     private ?string $addressGarant null;
  59.     #[ORM\Column(length255nullabletrue)]
  60.     private ?string $incomeGarant null;
  61.     #[ORM\Column(nullabletrue)]
  62.     private ?bool $isOwnerGarant null;
  63.     #[ORM\Column(length255nullabletrue)]
  64.     private ?string $rentGarant null;
  65.     #[ORM\Column(nullabletrue)]
  66.     private ?bool $certificatGarantMe null;
  67.     #[ORM\OneToMany(mappedBy'buildingFolder'targetEntityBuildingFolderDocument::class, cascade: ['persist''remove'])]
  68.     private Collection $buildingFolderDocuments;
  69.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  70.     private ?string $refusedDescription null;
  71.     #[ORM\Column(length255nullabletrue)]
  72.     private ?string $garantMeKey null;
  73.     #[ORM\Column(nullabletrue)]
  74.     private ?bool $isPaid null;
  75.     #[ORM\Column(nullabletrue)]
  76.     private ?bool $isPaidTenant null;
  77.     public function __construct()
  78.     {
  79.         $this->createdAt = new \DateTime();
  80.         $this->buildingFolderDocuments = new ArrayCollection();
  81.         $this->setState(BuildingFolder::PROGRESS);
  82.     }
  83.     public function getId(): ?int
  84.     {
  85.         return $this->id;
  86.     }
  87.     public function getTenant(): ?User
  88.     {
  89.         return $this->tenant;
  90.     }
  91.     public function setTenant(?User $tenant): self
  92.     {
  93.         $this->tenant $tenant;
  94.         return $this;
  95.     }
  96.     public function getMailContact(): ?string
  97.     {
  98.         return $this->mailContact;
  99.     }
  100.     public function setMailContact(?string $mailContact): self
  101.     {
  102.         $this->mailContact $mailContact;
  103.         return $this;
  104.     }
  105.     
  106.     public function getCreatedAt(): ?\DateTimeInterface
  107.     {
  108.         return $this->createdAt;
  109.     }
  110.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  111.     {
  112.         $this->createdAt $createdAt;
  113.         return $this;
  114.     }
  115.     public function getChangeStateAt(): ?\DateTimeInterface
  116.     {
  117.         return $this->changeStateAt;
  118.     }
  119.     public function setChangeStateAt(?\DateTimeInterface $changeStateAt): self
  120.     {
  121.         $this->changeStateAt $changeStateAt;
  122.         return $this;
  123.     }
  124.     public function getRefusedAt(): ?\DateTimeInterface
  125.     {
  126.         return $this->refusedAt;
  127.     }
  128.     public function setRefusedAt(?\DateTimeInterface $refusedAt): self
  129.     {
  130.         $this->refusedAt $refusedAt;
  131.         return $this;
  132.     }
  133.     public function getRefusedTex(): ?string
  134.     {
  135.         return $this->refusedTex;
  136.     }
  137.     public function setRefusedTex(?string $refusedTex): self
  138.     {
  139.         $this->refusedTex $refusedTex;
  140.         return $this;
  141.     }
  142.     public function getBuilding(): ?Building
  143.     {
  144.         return $this->building;
  145.     }
  146.     public function setBuilding(?Building $building): self
  147.     {
  148.         $this->building $building;
  149.         $this->mailContact $building->getMailContact();
  150.         return $this;
  151.     }
  152.     public function getState(): ?string
  153.     {
  154.         return $this->state;
  155.     }
  156.     public function setState(?string $state): self
  157.     {
  158.         $this->state $state;
  159.         $this->setChangeStateAt(new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris')));
  160.         return $this;
  161.     }
  162.     public function getResidence(): ?Residence
  163.     {
  164.         return $this->residence;
  165.     }
  166.     public function setResidence(?Residence $residence): self
  167.     {
  168.         $this->residence $residence;
  169.         return $this;
  170.     }
  171.     public function isIsBlockBuilding(): ?bool
  172.     {
  173.         return $this->isBlockBuilding;
  174.     }
  175.     public function setIsBlockBuilding(?bool $isBlockBuilding): self
  176.     {
  177.         $this->isBlockBuilding $isBlockBuilding;
  178.         return $this;
  179.     }
  180.     public function isAsGarant(): ?bool
  181.     {
  182.         return $this->asGarant;
  183.     }
  184.     public function setAsGarant(bool $asGarant): self
  185.     {
  186.         $this->asGarant $asGarant;
  187.         return $this;
  188.     }
  189.     public function getLastNameGarant(): ?string
  190.     {
  191.         return $this->lastNameGarant;
  192.     }
  193.     public function setLastNameGarant(?string $lastNameGarant): self
  194.     {
  195.         $this->lastNameGarant $lastNameGarant;
  196.         return $this;
  197.     }
  198.     public function getFirstNameGarant(): ?string
  199.     {
  200.         return $this->firstNameGarant;
  201.     }
  202.     public function setFirstNameGarant(?string $firstNameGarant): self
  203.     {
  204.         $this->firstNameGarant $firstNameGarant;
  205.         return $this;
  206.     }
  207.     public function getPhoneGarant(): ?string
  208.     {
  209.         return $this->phoneGarant;
  210.     }
  211.     public function setPhoneGarant(?string $phoneGarant): self
  212.     {
  213.         $this->phoneGarant $phoneGarant;
  214.         return $this;
  215.     }
  216.     public function getEmailGarant(): ?string
  217.     {
  218.         return $this->emailGarant;
  219.     }
  220.     public function setEmailGarant(?string $emailGarant): self
  221.     {
  222.         $this->emailGarant $emailGarant;
  223.         return $this;
  224.     }
  225.     public function getAddressGarant(): ?string
  226.     {
  227.         return $this->addressGarant;
  228.     }
  229.     public function setAddressGarant(?string $addressGarant): self
  230.     {
  231.         $this->addressGarant $addressGarant;
  232.         return $this;
  233.     }
  234.     public function getIncomeGarant(): ?string
  235.     {
  236.         return $this->incomeGarant;
  237.     }
  238.     public function setIncomeGarant(?string $incomeGarant): self
  239.     {
  240.         $this->incomeGarant $incomeGarant;
  241.         return $this;
  242.     }
  243.     public function isIsOwnerGarant(): ?bool
  244.     {
  245.         return $this->isOwnerGarant;
  246.     }
  247.     public function setIsOwnerGarant(?bool $isOwnerGarant): self
  248.     {
  249.         $this->isOwnerGarant $isOwnerGarant;
  250.         return $this;
  251.     }
  252.     public function getRentGarant(): ?string
  253.     {
  254.         return $this->rentGarant;
  255.     }
  256.     public function setRentGarant(?string $rentGarant): self
  257.     {
  258.         $this->rentGarant $rentGarant;
  259.         return $this;
  260.     }
  261.     public function isCertificatGarantMe(): ?bool
  262.     {
  263.         return $this->certificatGarantMe;
  264.     }
  265.     public function setCertificatGarantMe(?bool $certificatGarantMe): self
  266.     {
  267.         $this->certificatGarantMe $certificatGarantMe;
  268.         return $this;
  269.     }
  270.     /**
  271.      * @return Collection<int, BuildingFolderDocument>
  272.      */
  273.     public function getBuildingFolderDocuments(): Collection
  274.     {
  275.         return $this->buildingFolderDocuments;
  276.     }
  277.     public function addBuildingFolderDocument(BuildingFolderDocument $buildingFolderDocument): self
  278.     {
  279.         if (!$this->buildingFolderDocuments->contains($buildingFolderDocument)) {
  280.             $this->buildingFolderDocuments->add($buildingFolderDocument);
  281.             $buildingFolderDocument->setBuildingFolder($this);
  282.         }
  283.         return $this;
  284.     }
  285.     public function removeBuildingFolderDocument(BuildingFolderDocument $buildingFolderDocument): self
  286.     {
  287.         if ($this->buildingFolderDocuments->removeElement($buildingFolderDocument)) {
  288.             // set the owning side to null (unless already changed)
  289.             if ($buildingFolderDocument->getBuildingFolder() === $this) {
  290.                 $buildingFolderDocument->setBuildingFolder(null);
  291.             }
  292.         }
  293.         return $this;
  294.     }
  295.     public function getRefusedDescription(): ?string
  296.     {
  297.         return $this->refusedDescription;
  298.     }
  299.     public function setRefusedDescription(?string $refusedDescription): self
  300.     {
  301.         $this->refusedDescription $refusedDescription;
  302.         return $this;
  303.     }
  304.     public function getGarantMeKey(): ?string
  305.     {
  306.         return $this->garantMeKey;
  307.     }
  308.     public function setGarantMeKey(?string $garantMeKey): self
  309.     {
  310.         $this->garantMeKey $garantMeKey;
  311.         return $this;
  312.     }
  313.     public function isIsPaid(): ?bool
  314.     {
  315.         return $this->isPaid;
  316.     }
  317.     public function setIsPaid(?bool $isPaid): self
  318.     {
  319.         $this->isPaid $isPaid;
  320.         return $this;
  321.     }
  322.     public function isIsPaidTenant(): ?bool
  323.     {
  324.         return $this->isPaidTenant;
  325.     }
  326.     public function setIsPaidTenant(?bool $isPaidTenant): self
  327.     {
  328.         $this->isPaidTenant $isPaidTenant;
  329.         return $this;
  330.     }
  331. }