<?php
namespace App\Entity;
use App\Repository\PropertyDetailsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Bedroom;
#[ORM\Entity(repositoryClass: PropertyDetailsRepository::class)]
#[ORM\Table(name: '`propertydetails`')]
class PropertyDetails
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(nullable: true, )]
protected ?int $bedroomNumber = null;
/*
#[ORM\Column (nullable: true)]
protected ?bool $property_available = null;
#[ORM\Column(nullable: true)]
protected ?bool $furnished = null;
#[ORM\Column(length: 255, nullable: true)]
protected ?string $deliveryType = null; #buy or rent?
#[ORM\Column(length: 255, nullable: true)]
protected ?string $rentalType = null; #by bedrooms or whole property?
#[ORM\Column(length: 255, nullable: true)]
protected ?string $size = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $builtType = null;
*/
#[ORM\Column(nullable: true)]
protected ?int $rentedRooms = null;
#[ORM\Column(nullable: true)]
protected ?bool $property_lift = null;
#[ORM\Column(nullable: true)]
protected ?bool $property_parking = null;
#[ORM\Column(nullable: true)]
protected ?bool $property_living_room = null;
#[ORM\Column(nullable: true)]
protected ?int $property_bathrooms = null;
#[ORM\Column(nullable: true)]
protected ?string $property_kitchen = null;
#[ORM\Column(nullable: true)]
private ?bool $pool = null;
#[ORM\Column(nullable: true)]
private ?bool $garden = null;
#[ORM\Column(nullable: true)]
private ?bool $gym = null;
#[ORM\Column(length: 2000, nullable: true)]
private ?string $extra = null;
#[ORM\OneToOne(mappedBy: 'propertyDetails', cascade: ['persist'])]
private ?PropertyList $propertyList;
#[ORM\OneToMany(mappedBy: 'propertyDetails', targetEntity: Bedroom::class, cascade: ['persist', 'remove'])]
#[ORM\OrderBy(["bedroom_name"=>"ASC"])]
private Collection $bedrooms;
#[ORM\Column(nullable: true)]
private ?bool $storage = null;
#[ORM\Column(length: 25, nullable: true)]
private ?string $hpo = null;
#[ORM\Column(nullable: true)]
private ?bool $terraza = null;
#[ORM\Column(length: 25, nullable: true)]
private ?string $gasCompany = null;
#[ORM\Column(length: 25, nullable: true)]
private ?string $waterCompany = null;
#[ORM\Column(length: 25, nullable: true)]
private ?string $electricityCompany = null;
#[ORM\Column(length: 25, nullable: true)]
private ?string $internetCompany = null;
#[ORM\Column(length: 255, nullable: true)]
private ?bool $aseo = null;
#[ORM\Column(length: 255, nullable: true)]
private ?bool $portero = null;
#[ORM\Column(length: 35, nullable: true)]
private ?string $kitchenType = null;
#[ORM\Column(length: 50, nullable: true)]
private ?string $bathroomType = null;
#[ORM\Column(nullable: true)]
private ?int $doubleBed = null;
#[ORM\Column(nullable: true)]
private ?int $singleBed = null;
#[ORM\Column(nullable: true)]
private ?int $toiletNumber = null;
#[ORM\Column(nullable: true)]
private ?bool $galeria = null;
#[ORM\Column(nullable: true)]
private ?bool $balcony = null;
#[ORM\Column(nullable: true)]
private ?bool $gas = null;
#[ORM\Column(nullable: true)]
private ?bool $electric = null;
#[ORM\Column(nullable: true)]
private ?bool $diesel = null;
#[ORM\Column(nullable: true)]
private ?bool $wood = null;
#[ORM\Column(nullable: true)]
private ?bool $centralWater = null;
#[ORM\Column(nullable: true)]
private ?bool $individualWater = null;
#[ORM\Column(nullable: true)]
private ?bool $ac = null;
#[ORM\Column(nullable: true)]
private ?int $parkingSpaces = null;
#[ORM\Column(nullable: true)]
private ?bool $disabledAccess = null;
#[ORM\Column(nullable: true)]
private ?bool $fumes = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $HPOexpiration = null;
#[ORM\Column(nullable: true)]
private ?bool $dressingRoom = null;
#[ORM\Column(nullable: true)]
private ?bool $patio = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ibi = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $community = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $cadastralReference = null;
public function __construct()
{
$this->bedrooms = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getBedroomNumber(): ?int
{
return $this->bedroomNumber;
}
public function setBedroomNumber(?int $bedroomNumber): self
{
$this->bedroomNumber = $bedroomNumber;
return $this;
}
/*
public function isPropertyAvailable(): ?bool
{
return $this->property_available;
}
public function setPropertyAvailable(bool $property_available): self
{
$this->property_available = $property_available;
return $this;
}
*/
public function getRentedRooms(): ?int
{
return $this->rentedRooms;
}
public function setRentedRooms(?int $rentedRooms): self
{
$this->rentedRooms = $rentedRooms;
return $this;
}
public function isPropertyLift(): ?bool
{
return $this->property_lift;
}
public function setPropertyLift(?bool $property_lift): self
{
$this->property_lift = $property_lift;
return $this;
}
public function isPropertyParking(): ?bool
{
return $this->property_parking;
}
public function setPropertyParking(?bool $property_parking): self
{
$this->property_parking = $property_parking;
return $this;
}
public function getPropertyBathrooms(): ?int
{
return $this->property_bathrooms;
}
public function setPropertyBathrooms(?int $property_bathrooms): self
{
$this->property_bathrooms = $property_bathrooms;
return $this;
}
public function getPropertyKitchen(): ?string
{
return $this->property_kitchen;
}
public function setPropertyKitchen(?string $property_kitchen): self
{
$this->property_kitchen = $property_kitchen;
return $this;
}
public function isPool(): ?bool
{
return $this->pool;
}
public function setPool(?bool $pool): self
{
$this->pool = $pool;
return $this;
}
public function isGarden(): ?bool
{
return $this->garden;
}
public function setGarden(?bool $garden): self
{
$this->garden = $garden;
return $this;
}
public function isGym(): ?bool
{
return $this->gym;
}
public function setGym(?bool $gym): self
{
$this->gym = $gym;
return $this;
}
public function getExtra(): ?string
{
return $this->extra;
}
public function setExtra(?string $extra): self
{
$this->extra = $extra;
return $this;
}
public function isPropertyLivingRoom(): ?bool
{
return $this->property_living_room;
}
public function setPropertyLivingRoom(?bool $property_living_room): self
{
$this->property_living_room = $property_living_room;
return $this;
}
public function getPropertyList(): ?PropertyList
{
return $this->propertyList;
}
public function setPropertyList(?PropertyList $propertyList): self
{
// unset the owning side of the relation if necessary
if ($propertyList === null && $this->propertyList !== null) {
$this->propertyList->setPropertyDetails(null);
}
// set the owning side of the relation if necessary
if ($propertyList !== null && $propertyList->getPropertyDetails() !== $this) {
$propertyList->setPropertyDetails($this);
}
$this->propertyList = $propertyList;
return $this;
}
/**
* @return Collection<int, Bedroom>
*/
public function getBedrooms(): Collection
{
return $this->bedrooms;
}
public function addBedroom(Bedroom $bedroom): self
{
if (!$this->bedrooms->contains($bedroom)) {
$this->bedrooms->add($bedroom);
$bedroom->setPropertyDetails($this);
}
return $this;
}
public function removeBedroom(Bedroom $bedroom): self
{
if ($this->bedrooms->removeElement($bedroom)) {
// set the owning side to null (unless already changed)
if ($bedroom->getPropertyDetails() === $this) {
$bedroom->setPropertyDetails(null);
}
}
return $this;
}
public function isStorage(): ?bool
{
return $this->storage;
}
public function setStorage(?bool $storage): self
{
$this->storage = $storage;
return $this;
}
public function getHpo(): ?string
{
return $this->hpo;
}
public function setHpo(?string $hpo): self
{
$this->hpo = $hpo;
return $this;
}
public function isTerraza(): ?bool
{
return $this->terraza;
}
public function setTerraza(?bool $terraza): self
{
$this->terraza = $terraza;
return $this;
}
public function getGasCompany(): ?string
{
return $this->gasCompany;
}
public function setGasCompany(?string $gasCompany): self
{
$this->gasCompany = $gasCompany;
return $this;
}
public function getWaterCompany(): ?string
{
return $this->waterCompany;
}
public function setWaterCompany(?string $waterCompany): self
{
$this->waterCompany = $waterCompany;
return $this;
}
public function getElectricityCompany(): ?string
{
return $this->electricityCompany;
}
public function setElectricityCompany(?string $electricityCompany): self
{
$this->electricityCompany = $electricityCompany;
return $this;
}
public function getInternetCompany(): ?string
{
return $this->internetCompany;
}
public function setInternetCompany(?string $internetCompany): self
{
$this->internetCompany = $internetCompany;
return $this;
}
public function getRentedRoomsString(): string
{
$bedrooms = $this->getBedrooms();
$rentedBedrooms = 0;
foreach ($this->getBedrooms() as $bedroom) {
if ($bedroom->isIsRented()) {
$rentedBedrooms++;
}
}
return "$rentedBedrooms/$bedrooms";
}
public function getAseo(): ?bool
{
return $this->aseo;
}
public function setAseo(?bool $aseo): self
{
$this->aseo = $aseo;
return $this;
}
public function getPortero(): ?bool
{
return $this->portero;
}
public function setPortero(?bool $portero): self
{
$this->portero = $portero;
return $this;
}
public function getKitchenType(): ?string
{
return $this->kitchenType;
}
public function setKitchenType(?string $kitchenType): self
{
$this->kitchenType = $kitchenType;
return $this;
}
public function getBathroomType(): ?string
{
return $this->bathroomType;
}
public function setBathroomType(?string $bathroomType): self
{
$this->bathroomType = $bathroomType;
return $this;
}
public function getDoubleBed(): ?int
{
return $this->doubleBed;
}
public function setDoubleBed(?int $doubleBed): self
{
$this->doubleBed = $doubleBed;
return $this;
}
public function getSingleBed(): ?int
{
return $this->singleBed;
}
public function setSingleBed(?int $singleBed): self
{
$this->singleBed = $singleBed;
return $this;
}
public function getToiletNumber(): ?int
{
return $this->toiletNumber;
}
public function setToiletNumber(?int $toiletNumber): self
{
$this->toiletNumber = $toiletNumber;
return $this;
}
public function isGaleria(): ?bool
{
return $this->galeria;
}
public function setGaleria(?bool $galeria): self
{
$this->galeria = $galeria;
return $this;
}
public function isBalcony(): ?bool
{
return $this->balcony;
}
public function setBalcony(?bool $balcony): self
{
$this->balcony = $balcony;
return $this;
}
public function isGas(): ?bool
{
return $this->gas;
}
public function setGas(?bool $gas): self
{
$this->gas = $gas;
return $this;
}
public function isElectric(): ?bool
{
return $this->electric;
}
public function setElectric(?bool $electric): self
{
$this->electric = $electric;
return $this;
}
public function isDiesel(): ?bool
{
return $this->diesel;
}
public function setDiesel(?bool $diesel): self
{
$this->diesel = $diesel;
return $this;
}
public function isWood(): ?bool
{
return $this->wood;
}
public function setWood(?bool $wood): self
{
$this->wood = $wood;
return $this;
}
public function isCentralWater(): ?bool
{
return $this->centralWater;
}
public function setCentralWater(?bool $centralWater): self
{
$this->centralWater = $centralWater;
return $this;
}
public function isIndividualWater(): ?bool
{
return $this->individualWater;
}
public function setIndividualWater(?bool $individualWater): self
{
$this->individualWater = $individualWater;
return $this;
}
public function isAc(): ?bool
{
return $this->ac;
}
public function setAc(?bool $ac): self
{
$this->ac = $ac;
return $this;
}
public function getParkingSpaces(): ?int
{
return $this->parkingSpaces;
}
public function setParkingSpaces(?int $parkingSpaces): self
{
$this->parkingSpaces = $parkingSpaces;
return $this;
}
public function isDisabledAccess(): ?bool
{
return $this->disabledAccess;
}
public function setDisabledAccess(?bool $disabledAccess): self
{
$this->disabledAccess = $disabledAccess;
return $this;
}
public function isFumes(): ?bool
{
return $this->fumes;
}
public function setFumes(?bool $fumes): self
{
$this->fumes = $fumes;
return $this;
}
public function getHPOexpiration(): ?\DateTimeInterface
{
return $this->HPOexpiration;
}
public function setHPOexpiration(?\DateTimeInterface $HPOexpiration): self
{
$this->HPOexpiration = $HPOexpiration;
return $this;
}
public function isDressingRoom(): ?bool
{
return $this->dressingRoom;
}
public function setDressingRoom(?bool $dressingRoom): self
{
$this->dressingRoom = $dressingRoom;
return $this;
}
public function isPatio(): ?bool
{
return $this->patio;
}
public function setPatio(?bool $patio): self
{
$this->patio = $patio;
return $this;
}
public function getIbi(): ?string
{
return $this->ibi;
}
public function setIbi(?string $ibi): static
{
$this->ibi = $ibi;
return $this;
}
public function getCommunity(): ?string
{
return $this->community;
}
public function setCommunity(?string $community): static
{
$this->community = $community;
return $this;
}
public function getCadastralReference(): ?string
{
return $this->cadastralReference;
}
public function setCadastralReference(?string $cadastralReference): static
{
$this->cadastralReference = $cadastralReference;
return $this;
}
}