src/Entity/Landlords.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LandlordsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassLandlordsRepository::class)]
  9. class Landlords
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255 nullabletrue)]
  16.     private ?string $landlordName null;
  17.     #[ORM\Column(length255 nullabletrue)]
  18.     private ?string $landlordSurname null;
  19.     #[ORM\Column(length255 nullabletrue)]
  20.     private ?string $landlordEmail null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $landlordAddress null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $landlordCity null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $landlordPostcode null;
  27.     #[ORM\Column(length255 nullabletrue)]
  28.     private ?string $landlordPhone null;
  29.     #[ORM\Column(nullabletrue)]
  30.     private ?int $totalProperties null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $landlordIBAN null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $building_number null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $apartment_number null;
  37. /*
  38.     /**
  39.      * @ORM\Embedded(class="Percentage")
  40.      */
  41.    //private $percentage;
  42. /*
  43.     #[ORM\OneToMany(mappedBy: 'landlords', targetEntity: PropertyList::class, cascade: ['persist', 'remove'])]
  44.     private Collection $property;
  45. */
  46.     #[ORM\OneToOne(mappedBy'landlord'cascade: ['persist','remove'])]
  47.     private ?User $users null;
  48.     #[ORM\ManyToMany(targetEntityPropertyList::class, inversedBy'landlords'cascade: ['persist'])]
  49.     private Collection $property;
  50.     #[ORM\OneToMany(mappedBy'landlord'targetEntityPercentage::class, cascade: ['persist''remove'])]
  51.     private Collection $percentages;
  52.     #[ORM\Column(length255nullabletrue)]
  53.     private ?string $floor null;
  54.     #[ORM\Column(length255nullabletrue)]
  55.     private ?string $bloque null;
  56.     #[ORM\Column(length255nullabletrue)]
  57.     private ?string $escalera null;
  58.     #[ORM\Column(length255nullabletrue)]
  59.     private ?string $province null;
  60.     #[ORM\Column(nullabletrue)]
  61.     private ?string $type null;
  62.     #[ORM\ManyToMany(targetEntityDocuments::class, mappedBy'landlord'cascade: ['persist','remove'])]
  63.     private Collection $documents;
  64.     #[ORM\ManyToOne(inversedBy'landlords')]
  65.     private ?Broker $broker null;
  66.     #[ORM\OneToMany(mappedBy'landlord'targetEntityDocsLandlords::class,  cascade: ['persist','remove'])]
  67.     private Collection $docsLandlords;
  68.     #[ORM\OneToMany(mappedBy'landlord'targetEntityMinutes::class)]
  69.     private Collection $minutes;
  70.     #[ORM\Column(nullabletrue)]
  71.     private ?bool $status null;
  72.     #[ORM\Column(nullabletrue)]
  73.     private ?\DateTimeImmutable $createdAt null;
  74.     private ?Landlords $existingLandlord=null;
  75.     #[ORM\Column(length20nullabletrue)]
  76.     private ?string $docIdentificacion null;
  77.     #[ORM\OneToMany(mappedBy'landlord'targetEntityLiquidaciones::class)]
  78.     private Collection $liquidaciones;
  79.     #[ORM\Column(length20nullabletrue)]
  80.     private ?string $idClienteContabilidad null;
  81.     #[ORM\OneToMany(mappedBy'propietarioFacturacion'targetEntityPropertyList::class)]
  82.     private Collection $propertyListsFacturacions;
  83.     #[ORM\OneToMany(mappedBy'landlord'targetEntityRecibosGestion::class)]
  84.     private Collection $recibosGestions;
  85.     /*
  86.     #[ORM\ManyToOne(inversedBy: 'landlord')]
  87.     private ?Percentage $percentage = null;
  88.     #[ORM\OneToMany(mappedBy: 'landlord', targetEntity: Percentage::class,cascade: ['persist', 'remove'])]
  89.     private Collection $percentages;
  90.     
  91.     */
  92.     public function __toString(): string
  93.     {
  94.         return $this->getLandlordName().' '.$this->getLandlordSurname();
  95.     }
  96.     public function __construct()
  97.     {
  98.         $this->property = new ArrayCollection();
  99.         $this->percentages = new ArrayCollection();
  100.         $this->documents = new ArrayCollection();
  101.         $this->docsLandlords = new ArrayCollection();
  102.         $this->minutes = new ArrayCollection();
  103.         $this->liquidaciones = new ArrayCollection();
  104.         $this->propertyListsFacturacions = new ArrayCollection();
  105.         $this->recibosGestions = new ArrayCollection();
  106.         
  107.     }
  108.     public function getId(): ?int
  109.     {
  110.         return $this->id;
  111.     }
  112.     public function getLandlordName(): ?string
  113.     {
  114.         return $this->landlordName;
  115.     }
  116.     public function setLandlordName(string $landlordName): self
  117.     {
  118.         $this->landlordName $landlordName;
  119.         return $this;
  120.     }
  121.     public function getLandlordSurname(): ?string
  122.     {
  123.         return $this->landlordSurname;
  124.     }
  125.     public function setLandlordSurname(string $landlordSurname): self
  126.     {
  127.         $this->landlordSurname $landlordSurname;
  128.         return $this;
  129.     }
  130.     public function getLandlordAddress(): ?string
  131.     {
  132.         return $this->landlordAddress;
  133.     }
  134.     public function setLandlordAddress(?string $landlordAddress): self
  135.     {
  136.         $this->landlordAddress $landlordAddress;
  137.         return $this;
  138.     }
  139.     public function getLandlordCity(): ?string
  140.     {
  141.         return $this->landlordCity;
  142.     }
  143.     public function setLandlordCity(?string $landlordCity): self
  144.     {
  145.         $this->landlordCity $landlordCity;
  146.         return $this;
  147.     }
  148.     public function getLandlordPostcode(): ?string
  149.     {
  150.         return $this->landlordPostcode;
  151.     }
  152.     public function setLandlordPostcode(?string $landlordPostcode): self
  153.     {
  154.         $this->landlordPostcode $landlordPostcode;
  155.         return $this;
  156.     }
  157.     public function getLandlordPhone(): ?string
  158.     {
  159.         return $this->landlordPhone;
  160.     }
  161.     public function setLandlordPhone(?string $landlordPhone): self
  162.     {
  163.         $this->landlordPhone $landlordPhone;
  164.         return $this;
  165.     }
  166.     public function getTotalProperties(): ?int
  167.     {
  168.         return $this->totalProperties;
  169.     }
  170.     public function setTotalProperties(?int $totalProperties): self
  171.     {
  172.         $this->totalProperties $totalProperties;
  173.         return $this;
  174.     }
  175.     public function getLandlordIBAN(): ?string
  176.     {
  177.         return $this->landlordIBAN;
  178.     }
  179.     public function setLandlordIBAN(?string $landlordIBAN): self
  180.     {
  181.         $this->landlordIBAN $landlordIBAN;
  182.         return $this;
  183.     }
  184.     public function getLandlordEmail(): ?string
  185.     {
  186.         return $this->landlordEmail;
  187.     }
  188.     public function setLandlordEmail(?string $landlordEmail): self
  189.     {
  190.         $this->landlordEmail $landlordEmail;
  191.         return $this;
  192.     }
  193.     public function getUsers(): ?User
  194.     {
  195.         return $this->users;
  196.     }
  197.     public function setUsers(?User $users): self
  198.     {
  199.         // unset the owning side of the relation if necessary
  200.         if ($users === null && $this->users !== null) {
  201.             $this->users->setLandlord(null);
  202.         }
  203.         // set the owning side of the relation if necessary
  204.         if ($users !== null && $users->getLandlord() !== $this) {
  205.             $users->setLandlord($this);
  206.         }
  207.         $this->users $users;
  208.         return $this;
  209.     }
  210.     public function getBuildingNumber(): ?string
  211.     {
  212.         return $this->building_number;
  213.     }
  214.     public function setBuildingNumber(?string $building_number): self
  215.     {
  216.         $this->building_number $building_number;
  217.         return $this;
  218.     }
  219.     public function getApartmentNumber(): ?string
  220.     {
  221.         return $this->apartment_number;
  222.     }
  223.     public function setApartmentNumber(?string $apartment_number): self
  224.     {
  225.         $this->apartment_number $apartment_number;
  226.         return $this;
  227.     }
  228.     /**
  229.      * @return Collection<int, PropertyList>
  230.      */
  231.     public function getProperty(): Collection
  232.     {
  233.         return $this->property;
  234.     }
  235.     public function addProperty(PropertyList $property): self
  236.     {
  237.         if (!$this->property->contains($property)) {
  238.             $this->property->add($property);
  239.         }
  240.         return $this;
  241.     }
  242.     public function removeProperty(PropertyList $property): self
  243.     {
  244.         $this->property->removeElement($property);
  245.         return $this;
  246.     }
  247.     
  248. /*
  249.     public function getPercentage(): ?Percentage
  250.     {
  251.         return $this->percentage;
  252.     }
  253.     public function setPercentage(?Percentage $percentage): self
  254.     {
  255.         $this->percentage = $percentage;
  256.         return $this;
  257.     }
  258. */
  259.     /**
  260.      * @return Collection<int, Percentage>
  261.      */
  262.     public function getPercentages(): Collection
  263.     {
  264.         return $this->percentages;
  265.     }
  266.     public function addPercentage(Percentage $percentage): self
  267.     {
  268.         if (!$this->percentages->contains($percentage)) {
  269.             $this->percentages->add($percentage);
  270.             $percentage->setLandlord($this);
  271.         }
  272.         return $this;
  273.     }
  274.     public function removePercentage(Percentage $percentage): self
  275.     {
  276.         if ($this->percentages->removeElement($percentage)) {
  277.             // set the owning side to null (unless already changed)
  278.             if ($percentage->getLandlord() === $this) {
  279.                 $percentage->setLandlord(null);
  280.             }
  281.         }
  282.         return $this;
  283.     }
  284.     public function getFloor(): ?string
  285.     {
  286.         return $this->floor;
  287.     }
  288.     public function setFloor(?string $floor): self
  289.     {
  290.         $this->floor $floor;
  291.         return $this;
  292.     }
  293.     public function getBloque(): ?string
  294.     {
  295.         return $this->bloque;
  296.     }
  297.     public function setBloque(?string $bloque): self
  298.     {
  299.         $this->bloque $bloque;
  300.         return $this;
  301.     }
  302.     public function getEscalera(): ?string
  303.     {
  304.         return $this->escalera;
  305.     }
  306.     public function setEscalera(?string $escalera): self
  307.     {
  308.         $this->escalera $escalera;
  309.         return $this;
  310.     }
  311.     public function getProvince(): ?string
  312.     {
  313.         return $this->province;
  314.     }
  315.     public function setProvince(?string $province): self
  316.     {
  317.         $this->province $province;
  318.         return $this;
  319.     }
  320.     public function getType(): ?string
  321.     {
  322.         return $this->type;
  323.     }
  324.     public function setType(?string $type): self
  325.     {
  326.         $this->type $type;
  327.         return $this;
  328.     }
  329.     /**
  330.      * @return Collection<int, Documents>
  331.      */
  332.     public function getDocuments(): Collection
  333.     {
  334.         return $this->documents;
  335.     }
  336.     public function addDocument(Documents $document): self
  337.     {
  338.         if (!$this->documents->contains($document)) {
  339.             $this->documents->add($document);
  340.             $document->addLandlord($this);
  341.         }
  342.         return $this;
  343.     }
  344.     public function removeDocument(Documents $document): self
  345.     {
  346.         if ($this->documents->removeElement($document)) {
  347.             $document->removeLandlord($this);
  348.         }
  349.         return $this;
  350.     }
  351.     public function getBroker(): ?Broker
  352.     {
  353.         return $this->broker;
  354.     }
  355.     public function setBroker(?Broker $broker): self
  356.     {
  357.         $this->broker $broker;
  358.         return $this;
  359.     }
  360.     /**
  361.      * @return Collection<int, DocsLandlords>
  362.      */
  363.     public function getDocsLandlords(): Collection
  364.     {
  365.         return $this->docsLandlords;
  366.     }
  367.     public function addDocsLandlord(DocsLandlords $docsLandlord): self
  368.     {
  369.         if (!$this->docsLandlords->contains($docsLandlord)) {
  370.             $this->docsLandlords->add($docsLandlord);
  371.             $docsLandlord->setLandlord($this);
  372.         }
  373.         return $this;
  374.     }
  375.     public function removeDocsLandlord(DocsLandlords $docsLandlord): self
  376.     {
  377.         if ($this->docsLandlords->removeElement($docsLandlord)) {
  378.             // set the owning side to null (unless already changed)
  379.             if ($docsLandlord->getLandlord() === $this) {
  380.                 $docsLandlord->setLandlord(null);
  381.             }
  382.         }
  383.         return $this;
  384.     }
  385.     /**
  386.      * @return Collection<int, Minutes>
  387.      */
  388.     public function getMinutes(): Collection
  389.     {
  390.         return $this->minutes;
  391.     }
  392.     public function addMinute(Minutes $minute): self
  393.     {
  394.         if (!$this->minutes->contains($minute)) {
  395.             $this->minutes->add($minute);
  396.             $minute->setLandlord($this);
  397.         }
  398.         return $this;
  399.     }
  400.     public function removeMinute(Minutes $minute): self
  401.     {
  402.         if ($this->minutes->removeElement($minute)) {
  403.             // set the owning side to null (unless already changed)
  404.             if ($minute->getLandlord() === $this) {
  405.                 $minute->setLandlord(null);
  406.             }
  407.         }
  408.         return $this;
  409.     }
  410.     public function isStatus(): ?bool
  411.     {
  412.         return $this->status;
  413.     }
  414.     public function setStatus(?bool $status): static
  415.     {
  416.         $this->status $status;
  417.         return $this;
  418.     }
  419.     public function getCreatedAt(): ?\DateTimeImmutable
  420.     {
  421.         return $this->createdAt;
  422.     }
  423.     public function setCreatedAt(?\DateTimeImmutable $createdAt): static
  424.     {
  425.         $this->createdAt $createdAt;
  426.         return $this;
  427.     }
  428.     public function setExistingLandlord(?Landlords $existingLandlord){
  429.         $this->existingLandlord=$existingLandlord;
  430.     }
  431.     public function getExistingLandlord():?Landlords{
  432.         return $this->existingLandlord;
  433.     }
  434.     public function getDocIdentificacion(): ?string
  435.     {
  436.         return $this->docIdentificacion;
  437.     }
  438.     public function setDocIdentificacion(?string $docIdentificacion): static
  439.     {
  440.         $this->docIdentificacion $docIdentificacion;
  441.         return $this;
  442.     }
  443.     /**
  444.      * @return Collection<int, Liquidaciones>
  445.      */
  446.     public function getLiquidaciones(): Collection
  447.     {
  448.         return $this->liquidaciones;
  449.     }
  450.     public function addLiquidacione(Liquidaciones $liquidacione): static
  451.     {
  452.         if (!$this->liquidaciones->contains($liquidacione)) {
  453.             $this->liquidaciones->add($liquidacione);
  454.             $liquidacione->setLandlord($this);
  455.         }
  456.         return $this;
  457.     }
  458.     public function removeLiquidacione(Liquidaciones $liquidacione): static
  459.     {
  460.         if ($this->liquidaciones->removeElement($liquidacione)) {
  461.             // set the owning side to null (unless already changed)
  462.             if ($liquidacione->getLandlord() === $this) {
  463.                 $liquidacione->setLandlord(null);
  464.             }
  465.         }
  466.         return $this;
  467.     }
  468.     public function getIdClienteContabilidad(): ?string
  469.     {
  470.         return $this->idClienteContabilidad;
  471.     }
  472.     public function setIdClienteContabilidad(?string $idClienteContabilidad): static
  473.     {
  474.         $this->idClienteContabilidad $idClienteContabilidad;
  475.         return $this;
  476.     }
  477.     /**
  478.      * @return Collection<int, PropertyList>
  479.      */
  480.     public function getPropertyListsFacturacions(): Collection
  481.     {
  482.         return $this->propertyListsFacturacions;
  483.     }
  484.     public function addPropertyListsFacturacion(PropertyList $propertyListsFacturacion): static
  485.     {
  486.         if (!$this->propertyListsFacturacions->contains($propertyListsFacturacion)) {
  487.             $this->propertyListsFacturacions->add($propertyListsFacturacion);
  488.             $propertyListsFacturacion->setPropietarioFacturacion($this);
  489.         }
  490.         return $this;
  491.     }
  492.     public function removePropertyListsFacturacion(PropertyList $propertyListsFacturacion): static
  493.     {
  494.         if ($this->propertyListsFacturacions->removeElement($propertyListsFacturacion)) {
  495.             // set the owning side to null (unless already changed)
  496.             if ($propertyListsFacturacion->getPropietarioFacturacion() === $this) {
  497.                 $propertyListsFacturacion->setPropietarioFacturacion(null);
  498.             }
  499.         }
  500.         return $this;
  501.     }
  502.     /**
  503.      * @return Collection<int, RecibosGestion>
  504.      */
  505.     public function getRecibosGestions(): Collection
  506.     {
  507.         return $this->recibosGestions;
  508.     }
  509.     public function addRecibosGestion(RecibosGestion $recibosGestion): static
  510.     {
  511.         if (!$this->recibosGestions->contains($recibosGestion)) {
  512.             $this->recibosGestions->add($recibosGestion);
  513.             $recibosGestion->setLandlord($this);
  514.         }
  515.         return $this;
  516.     }
  517.     public function removeRecibosGestion(RecibosGestion $recibosGestion): static
  518.     {
  519.         if ($this->recibosGestions->removeElement($recibosGestion)) {
  520.             // set the owning side to null (unless already changed)
  521.             if ($recibosGestion->getLandlord() === $this) {
  522.                 $recibosGestion->setLandlord(null);
  523.             }
  524.         }
  525.         return $this;
  526.     }
  527. }