<?php
namespace App\Entity;
use App\Repository\LandlordsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LandlordsRepository::class)]
class Landlords
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255 , nullable: true)]
private ?string $landlordName = null;
#[ORM\Column(length: 255 , nullable: true)]
private ?string $landlordSurname = null;
#[ORM\Column(length: 255 , nullable: true)]
private ?string $landlordEmail = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $landlordAddress = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $landlordCity = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $landlordPostcode = null;
#[ORM\Column(length: 255 , nullable: true)]
private ?string $landlordPhone = null;
#[ORM\Column(nullable: true)]
private ?int $totalProperties = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $landlordIBAN = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $building_number = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $apartment_number = null;
/*
/**
* @ORM\Embedded(class="Percentage")
*/
//private $percentage;
/*
#[ORM\OneToMany(mappedBy: 'landlords', targetEntity: PropertyList::class, cascade: ['persist', 'remove'])]
private Collection $property;
*/
#[ORM\OneToOne(mappedBy: 'landlord', cascade: ['persist','remove'])]
private ?User $users = null;
#[ORM\ManyToMany(targetEntity: PropertyList::class, inversedBy: 'landlords', cascade: ['persist'])]
private Collection $property;
#[ORM\OneToMany(mappedBy: 'landlord', targetEntity: Percentage::class, cascade: ['persist', 'remove'])]
private Collection $percentages;
#[ORM\Column(length: 255, nullable: true)]
private ?string $floor = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $bloque = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $escalera = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $province = null;
#[ORM\Column(nullable: true)]
private ?string $type = null;
#[ORM\ManyToMany(targetEntity: Documents::class, mappedBy: 'landlord', cascade: ['persist','remove'])]
private Collection $documents;
#[ORM\ManyToOne(inversedBy: 'landlords')]
private ?Broker $broker = null;
#[ORM\OneToMany(mappedBy: 'landlord', targetEntity: DocsLandlords::class, cascade: ['persist','remove'])]
private Collection $docsLandlords;
#[ORM\OneToMany(mappedBy: 'landlord', targetEntity: Minutes::class)]
private Collection $minutes;
#[ORM\Column(nullable: true)]
private ?bool $status = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $createdAt = null;
private ?Landlords $existingLandlord=null;
#[ORM\Column(length: 20, nullable: true)]
private ?string $docIdentificacion = null;
#[ORM\OneToMany(mappedBy: 'landlord', targetEntity: Liquidaciones::class)]
private Collection $liquidaciones;
#[ORM\Column(length: 20, nullable: true)]
private ?string $idClienteContabilidad = null;
#[ORM\OneToMany(mappedBy: 'propietarioFacturacion', targetEntity: PropertyList::class)]
private Collection $propertyListsFacturacions;
#[ORM\OneToMany(mappedBy: 'landlord', targetEntity: RecibosGestion::class)]
private Collection $recibosGestions;
/*
#[ORM\ManyToOne(inversedBy: 'landlord')]
private ?Percentage $percentage = null;
#[ORM\OneToMany(mappedBy: 'landlord', targetEntity: Percentage::class,cascade: ['persist', 'remove'])]
private Collection $percentages;
*/
public function __toString(): string
{
return $this->getLandlordName().' '.$this->getLandlordSurname();
}
public function __construct()
{
$this->property = new ArrayCollection();
$this->percentages = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->docsLandlords = new ArrayCollection();
$this->minutes = new ArrayCollection();
$this->liquidaciones = new ArrayCollection();
$this->propertyListsFacturacions = new ArrayCollection();
$this->recibosGestions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLandlordName(): ?string
{
return $this->landlordName;
}
public function setLandlordName(string $landlordName): self
{
$this->landlordName = $landlordName;
return $this;
}
public function getLandlordSurname(): ?string
{
return $this->landlordSurname;
}
public function setLandlordSurname(string $landlordSurname): self
{
$this->landlordSurname = $landlordSurname;
return $this;
}
public function getLandlordAddress(): ?string
{
return $this->landlordAddress;
}
public function setLandlordAddress(?string $landlordAddress): self
{
$this->landlordAddress = $landlordAddress;
return $this;
}
public function getLandlordCity(): ?string
{
return $this->landlordCity;
}
public function setLandlordCity(?string $landlordCity): self
{
$this->landlordCity = $landlordCity;
return $this;
}
public function getLandlordPostcode(): ?string
{
return $this->landlordPostcode;
}
public function setLandlordPostcode(?string $landlordPostcode): self
{
$this->landlordPostcode = $landlordPostcode;
return $this;
}
public function getLandlordPhone(): ?string
{
return $this->landlordPhone;
}
public function setLandlordPhone(?string $landlordPhone): self
{
$this->landlordPhone = $landlordPhone;
return $this;
}
public function getTotalProperties(): ?int
{
return $this->totalProperties;
}
public function setTotalProperties(?int $totalProperties): self
{
$this->totalProperties = $totalProperties;
return $this;
}
public function getLandlordIBAN(): ?string
{
return $this->landlordIBAN;
}
public function setLandlordIBAN(?string $landlordIBAN): self
{
$this->landlordIBAN = $landlordIBAN;
return $this;
}
public function getLandlordEmail(): ?string
{
return $this->landlordEmail;
}
public function setLandlordEmail(?string $landlordEmail): self
{
$this->landlordEmail = $landlordEmail;
return $this;
}
public function getUsers(): ?User
{
return $this->users;
}
public function setUsers(?User $users): self
{
// unset the owning side of the relation if necessary
if ($users === null && $this->users !== null) {
$this->users->setLandlord(null);
}
// set the owning side of the relation if necessary
if ($users !== null && $users->getLandlord() !== $this) {
$users->setLandlord($this);
}
$this->users = $users;
return $this;
}
public function getBuildingNumber(): ?string
{
return $this->building_number;
}
public function setBuildingNumber(?string $building_number): self
{
$this->building_number = $building_number;
return $this;
}
public function getApartmentNumber(): ?string
{
return $this->apartment_number;
}
public function setApartmentNumber(?string $apartment_number): self
{
$this->apartment_number = $apartment_number;
return $this;
}
/**
* @return Collection<int, PropertyList>
*/
public function getProperty(): Collection
{
return $this->property;
}
public function addProperty(PropertyList $property): self
{
if (!$this->property->contains($property)) {
$this->property->add($property);
}
return $this;
}
public function removeProperty(PropertyList $property): self
{
$this->property->removeElement($property);
return $this;
}
/*
public function getPercentage(): ?Percentage
{
return $this->percentage;
}
public function setPercentage(?Percentage $percentage): self
{
$this->percentage = $percentage;
return $this;
}
*/
/**
* @return Collection<int, Percentage>
*/
public function getPercentages(): Collection
{
return $this->percentages;
}
public function addPercentage(Percentage $percentage): self
{
if (!$this->percentages->contains($percentage)) {
$this->percentages->add($percentage);
$percentage->setLandlord($this);
}
return $this;
}
public function removePercentage(Percentage $percentage): self
{
if ($this->percentages->removeElement($percentage)) {
// set the owning side to null (unless already changed)
if ($percentage->getLandlord() === $this) {
$percentage->setLandlord(null);
}
}
return $this;
}
public function getFloor(): ?string
{
return $this->floor;
}
public function setFloor(?string $floor): self
{
$this->floor = $floor;
return $this;
}
public function getBloque(): ?string
{
return $this->bloque;
}
public function setBloque(?string $bloque): self
{
$this->bloque = $bloque;
return $this;
}
public function getEscalera(): ?string
{
return $this->escalera;
}
public function setEscalera(?string $escalera): self
{
$this->escalera = $escalera;
return $this;
}
public function getProvince(): ?string
{
return $this->province;
}
public function setProvince(?string $province): self
{
$this->province = $province;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
/**
* @return Collection<int, Documents>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Documents $document): self
{
if (!$this->documents->contains($document)) {
$this->documents->add($document);
$document->addLandlord($this);
}
return $this;
}
public function removeDocument(Documents $document): self
{
if ($this->documents->removeElement($document)) {
$document->removeLandlord($this);
}
return $this;
}
public function getBroker(): ?Broker
{
return $this->broker;
}
public function setBroker(?Broker $broker): self
{
$this->broker = $broker;
return $this;
}
/**
* @return Collection<int, DocsLandlords>
*/
public function getDocsLandlords(): Collection
{
return $this->docsLandlords;
}
public function addDocsLandlord(DocsLandlords $docsLandlord): self
{
if (!$this->docsLandlords->contains($docsLandlord)) {
$this->docsLandlords->add($docsLandlord);
$docsLandlord->setLandlord($this);
}
return $this;
}
public function removeDocsLandlord(DocsLandlords $docsLandlord): self
{
if ($this->docsLandlords->removeElement($docsLandlord)) {
// set the owning side to null (unless already changed)
if ($docsLandlord->getLandlord() === $this) {
$docsLandlord->setLandlord(null);
}
}
return $this;
}
/**
* @return Collection<int, Minutes>
*/
public function getMinutes(): Collection
{
return $this->minutes;
}
public function addMinute(Minutes $minute): self
{
if (!$this->minutes->contains($minute)) {
$this->minutes->add($minute);
$minute->setLandlord($this);
}
return $this;
}
public function removeMinute(Minutes $minute): self
{
if ($this->minutes->removeElement($minute)) {
// set the owning side to null (unless already changed)
if ($minute->getLandlord() === $this) {
$minute->setLandlord(null);
}
}
return $this;
}
public function isStatus(): ?bool
{
return $this->status;
}
public function setStatus(?bool $status): static
{
$this->status = $status;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function setExistingLandlord(?Landlords $existingLandlord){
$this->existingLandlord=$existingLandlord;
}
public function getExistingLandlord():?Landlords{
return $this->existingLandlord;
}
public function getDocIdentificacion(): ?string
{
return $this->docIdentificacion;
}
public function setDocIdentificacion(?string $docIdentificacion): static
{
$this->docIdentificacion = $docIdentificacion;
return $this;
}
/**
* @return Collection<int, Liquidaciones>
*/
public function getLiquidaciones(): Collection
{
return $this->liquidaciones;
}
public function addLiquidacione(Liquidaciones $liquidacione): static
{
if (!$this->liquidaciones->contains($liquidacione)) {
$this->liquidaciones->add($liquidacione);
$liquidacione->setLandlord($this);
}
return $this;
}
public function removeLiquidacione(Liquidaciones $liquidacione): static
{
if ($this->liquidaciones->removeElement($liquidacione)) {
// set the owning side to null (unless already changed)
if ($liquidacione->getLandlord() === $this) {
$liquidacione->setLandlord(null);
}
}
return $this;
}
public function getIdClienteContabilidad(): ?string
{
return $this->idClienteContabilidad;
}
public function setIdClienteContabilidad(?string $idClienteContabilidad): static
{
$this->idClienteContabilidad = $idClienteContabilidad;
return $this;
}
/**
* @return Collection<int, PropertyList>
*/
public function getPropertyListsFacturacions(): Collection
{
return $this->propertyListsFacturacions;
}
public function addPropertyListsFacturacion(PropertyList $propertyListsFacturacion): static
{
if (!$this->propertyListsFacturacions->contains($propertyListsFacturacion)) {
$this->propertyListsFacturacions->add($propertyListsFacturacion);
$propertyListsFacturacion->setPropietarioFacturacion($this);
}
return $this;
}
public function removePropertyListsFacturacion(PropertyList $propertyListsFacturacion): static
{
if ($this->propertyListsFacturacions->removeElement($propertyListsFacturacion)) {
// set the owning side to null (unless already changed)
if ($propertyListsFacturacion->getPropietarioFacturacion() === $this) {
$propertyListsFacturacion->setPropietarioFacturacion(null);
}
}
return $this;
}
/**
* @return Collection<int, RecibosGestion>
*/
public function getRecibosGestions(): Collection
{
return $this->recibosGestions;
}
public function addRecibosGestion(RecibosGestion $recibosGestion): static
{
if (!$this->recibosGestions->contains($recibosGestion)) {
$this->recibosGestions->add($recibosGestion);
$recibosGestion->setLandlord($this);
}
return $this;
}
public function removeRecibosGestion(RecibosGestion $recibosGestion): static
{
if ($this->recibosGestions->removeElement($recibosGestion)) {
// set the owning side to null (unless already changed)
if ($recibosGestion->getLandlord() === $this) {
$recibosGestion->setLandlord(null);
}
}
return $this;
}
}