src/Entity/Location.php line 17
<?phpnamespace App\Entity;use App\Repository\LocationRepository;use App\Traits\TimeStampTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Uid\Uuid;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: LocationRepository::class)]#[ORM\HasLifecycleCallbacks]class Location{use TimeStampTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 100)]private ?string $code = null;#[ORM\ManyToOne(cascade: ['all'], fetch: 'EAGER', inversedBy: 'locations')]private ?Locataire $locataire = null;#[ORM\ManyToOne(inversedBy: 'locations')]private ?Habitat $habitat = null;#[ORM\ManyToOne(inversedBy: 'locations')]private ?User $createdBy = null;#[ORM\Column]private ?bool $status = null;#[ORM\Column(nullable: true)]private ?bool $occuper = null;#[ORM\Column(length: 255, nullable: true)]private ?string $commentaire = null;#[ORM\Column(length: 15, nullable: true)]private ?string $garanty = null;#[ORM\OneToMany(mappedBy: 'location', targetEntity: PaymentGaranty::class)]private Collection $paymentGaranties;#[ORM\Column(length: 15, nullable: true)]private ?string $maxGaranty = null;#[ORM\Column(length: 50, nullable: true)]private ?string $paymentDueDate = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)]private ?string $price = null;#[ORM\Column(type: 'date', nullable: true)]private $endLocationAt;#[ORM\Column(length: 255, nullable: true)]private ?string $commentaire2 = null;#[ORM\Column(length: 100, nullable: true)]private ?string $type = null;#[ORM\Column(type: 'datetime', nullable: true)]private $startAt;#[ORM\Column(type: 'datetime', nullable: true)]private $endAt;#[ORM\ManyToOne(inversedBy: 'locations')]private ?Entreprise $marchand = null;#[ORM\Column(length: 100, nullable: true)]private ?string $locationUsage = null;#[ORM\Column(length: 25, nullable: true)]private ?string $duree = null;#[ORM\OneToMany(mappedBy: 'location', targetEntity: ContractBail::class)]private Collection $contrat;#[ORM\OneToMany(mappedBy: 'location', targetEntity: Payment::class, cascade: ['all'], fetch: 'EAGER')]private Collection $payments;#[ORM\OneToMany(mappedBy: 'location', targetEntity: Incident::class)]private Collection $incidents;#[ORM\Column(length: 25, nullable: true)]private ?string $paymentPeriod = null;#[ORM\Column(length: 25, nullable: true)]private ?string $typeGaranty = null;#[ORM\Column(length: 25, nullable: true)]private ?string $reconduction = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)]private ?string $garantyTobepaid = null;#[ORM\Column(length: 10, nullable: true)]private ?string $mode = null;#[ORM\Column(type: 'uuid', unique: true, nullable: true)]private ?Uuid $uuid;#[ORM\Column(nullable: true)]private ?bool $reserver = null;#[ORM\Column(length: 25, nullable: true)]private ?string $locationType = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)]private ?string $lastExpenseAmount = null;#[ORM\OneToMany(mappedBy: 'location', targetEntity: ChargeAllocation::class)]private Collection $chargeAllocations;#[ORM\Column(nullable: true)]private ?int $occupants = null;#[ORM\OneToMany(mappedBy: 'Location', targetEntity: Charge::class)]private Collection $charges;#[ORM\ManyToOne(inversedBy: 'locations')]private ?Residence $residence = null;public function __construct(){$this->paymentGaranties = new ArrayCollection();$this->contrat = new ArrayCollection();$this->payments = new ArrayCollection();$this->incidents = new ArrayCollection();$this->chargeAllocations = new ArrayCollection();$this->charges = new ArrayCollection();}/*** @return int|null*/public function getId(): ?int{return $this->id;}/*** @param int|null $id*/public function setId(?int $id): void{$this->id = $id;}/*** @return string|null*/public function getCode(): ?string{return $this->code;}/*** @param string|null $code*/public function setCode(?string $code): void{$this->code = $code;}/*** @return Locataire|null*/public function getLocataire(): ?Locataire{return $this->locataire;}/*** @param Locataire|null $locataire*/public function setLocataire(?Locataire $locataire): void{$this->locataire = $locataire;}/*** @return Habitat|null*/public function getHabitat(): ?Habitat{return $this->habitat;}/*** @param Habitat|null $habitat*/public function setHabitat(?Habitat $habitat): void{$this->habitat = $habitat;}/*** @return User|null*/public function getCreatedBy(): ?User{return $this->createdBy;}/*** @param User|null $createdBy*/public function setCreatedBy(?User $createdBy): void{$this->createdBy = $createdBy;}/*** @return bool|null*/public function getStatus(): ?bool{return $this->status;}/*** @param bool|null $status*/public function setStatus(?bool $status): void{$this->status = $status;}/*** @return bool|null*/public function getOccuper(): ?bool{return $this->occuper;}/*** @param bool|null $occuper*/public function setOccuper(?bool $occuper): void{$this->occuper = $occuper;}/*** @return string|null*/public function getCommentaire(): ?string{return $this->commentaire;}/*** @param string|null $commentaire*/public function setCommentaire(?string $commentaire): void{$this->commentaire = $commentaire;}/*** @return string|null*/public function getGaranty(): ?string{return $this->garanty;}/*** @param string|null $garanty*/public function setGaranty(?string $garanty): void{$this->garanty = $garanty;}/*** @return ArrayCollection|Collection*/public function getPaymentGaranties(): ArrayCollection|Collection{return $this->paymentGaranties;}/*** @param ArrayCollection|Collection $paymentGaranties*/public function setPaymentGaranties(ArrayCollection|Collection $paymentGaranties): void{$this->paymentGaranties = $paymentGaranties;}/*** @return string|null*/public function getMaxGaranty(): ?string{return $this->maxGaranty;}/*** @param string|null $maxGaranty*/public function setMaxGaranty(?string $maxGaranty): void{$this->maxGaranty = $maxGaranty;}/*** @return string|null*/public function getPaymentDueDate(): ?string{return $this->paymentDueDate;}/*** @param string|null $paymentDueDate*/public function setPaymentDueDate(?string $paymentDueDate): void{$this->paymentDueDate = $paymentDueDate;}/*** @return string|null*/public function getPrice(): ?string{return $this->price;}/*** @param string|null $price*/public function setPrice(?string $price): void{$this->price = $price;}/*** @return mixed*/public function getEndLocationAt(){return $this->endLocationAt;}/*** @param mixed $endLocationAt*/public function setEndLocationAt($endLocationAt): void{$this->endLocationAt = $endLocationAt;}/*** @return string|null*/public function getCommentaire2(): ?string{return $this->commentaire2;}/*** @param string|null $commentaire2*/public function setCommentaire2(?string $commentaire2): void{$this->commentaire2 = $commentaire2;}/*** @return string|null*/public function getType(): ?string{return $this->type;}/*** @param string|null $type*/public function setType(?string $type): void{$this->type = $type;}/*** @return mixed*/public function getStartAt(){return $this->startAt;}/*** @param mixed $startAt*/public function setStartAt($startAt): void{$this->startAt = $startAt;}/*** @return mixed*/public function getEndAt(){return $this->endAt;}/*** @param mixed $endAt*/public function setEndAt($endAt): void{$this->endAt = $endAt;}/*** @return Entreprise|null*/public function getMarchand(): ?Entreprise{return $this->marchand;}/*** @param Entreprise|null $marchand*/public function setMarchand(?Entreprise $marchand): void{$this->marchand = $marchand;}/*** @return string|null*/public function getLocationUsage(): ?string{return $this->locationUsage;}/*** @param string|null $locationUsage*/public function setLocationUsage(?string $locationUsage): void{$this->locationUsage = $locationUsage;}/*** @return string|null*/public function getDuree(): ?string{return $this->duree;}/*** @param string|null $duree*/public function setDuree(?string $duree): void{$this->duree = $duree;}/*** @return ArrayCollection|Collection*/public function getContrat(): ArrayCollection|Collection{return $this->contrat;}/*** @param ArrayCollection|Collection $contrat*/public function setContrat(ArrayCollection|Collection $contrat): void{$this->contrat = $contrat;}/*** @return ArrayCollection|Collection*/public function getPayments(): ArrayCollection|Collection{return $this->payments;}/*** @param ArrayCollection|Collection $payments*/public function setPayments(ArrayCollection|Collection $payments): void{$this->payments = $payments;}public function __toString(){return $this->getLocataire()->getFirstname()." ".$this->getLocataire()->getName()." ".$this->getLocataire()->getLastname();}/*** @return Collection<int, Incident>*/public function getIncidents(): Collection{return $this->incidents;}public function addIncident(Incident $incident): static{if (!$this->incidents->contains($incident)) {$this->incidents->add($incident);$incident->setLocation($this);}return $this;}public function removeIncident(Incident $incident): static{if ($this->incidents->removeElement($incident)) {// set the owning side to null (unless already changed)if ($incident->getLocation() === $this) {$incident->setLocation(null);}}return $this;}public function getPaymentPeriod(): ?string{return $this->paymentPeriod;}public function setPaymentPeriod(?string $paymentPeriod): static{$this->paymentPeriod = $paymentPeriod;return $this;}public function getTypeGaranty(): ?string{return $this->typeGaranty;}public function setTypeGaranty(?string $typeGaranty): static{$this->typeGaranty = $typeGaranty;return $this;}public function getReconduction(): ?string{return $this->reconduction;}public function setReconduction(?string $reconduction): static{$this->reconduction = $reconduction;return $this;}public function getGarantyTobepaid(): ?string{return $this->garantyTobepaid;}public function setGarantyTobepaid(?string $garantyTobepaid): static{$this->garantyTobepaid = $garantyTobepaid;return $this;}public function getMode(): ?string{return $this->mode;}public function setMode(?string $mode): static{$this->mode = $mode;return $this;}public function getUuid(): ?Uuid{return $this->uuid;}public function setUuid(Uuid $uuid): self{$this->uuid = $uuid;return $this;}public function isReserver(): ?bool{return $this->reserver;}public function setReserver(?bool $reserver): static{$this->reserver = $reserver;return $this;}public function getLocationType(): ?string{return $this->locationType;}public function setLocationType(?string $locationType): static{$this->locationType = $locationType;return $this;}public function getLastExpenseAmount(): ?string{return $this->lastExpenseAmount;}public function setLastExpenseAmount(?string $lastExpenseAmount): static{$this->lastExpenseAmount = $lastExpenseAmount;return $this;}/*** @return Collection<int, ChargeAllocation>*/public function getChargeAllocations(): Collection{return $this->chargeAllocations;}public function addChargeAllocation(ChargeAllocation $chargeAllocation): static{if (!$this->chargeAllocations->contains($chargeAllocation)) {$this->chargeAllocations->add($chargeAllocation);$chargeAllocation->setLocation($this);}return $this;}public function removeChargeAllocation(ChargeAllocation $chargeAllocation): static{if ($this->chargeAllocations->removeElement($chargeAllocation)) {// set the owning side to null (unless already changed)if ($chargeAllocation->getLocation() === $this) {$chargeAllocation->setLocation(null);}}return $this;}public function getOccupants(): ?int{return $this->occupants;}public function setOccupants(?int $occupants): static{$this->occupants = $occupants;return $this;}/*** @return Collection<int, Charge>*/public function getCharges(): Collection{return $this->charges;}public function addCharge(Charge $charge): static{if (!$this->charges->contains($charge)) {$this->charges->add($charge);$charge->setLocation($this);}return $this;}public function removeCharge(Charge $charge): static{if ($this->charges->removeElement($charge)) {// set the owning side to null (unless already changed)if ($charge->getLocation() === $this) {$charge->setLocation(null);}}return $this;}public function getResidence(): ?Residence{return $this->residence;}public function setResidence(?Residence $residence): static{$this->residence = $residence;return $this;}}