<?php
namespace App\Entity;
use App\Repository\MonthlyPaymentsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: MonthlyPaymentsRepository::class)]
class MonthlyPayments
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $amountPaid = null;
#[ORM\ManyToOne(inversedBy: 'monthlyPayments', cascade: ['persist',])]
private ?PropertyList $property = null;
#[ORM\ManyToOne(inversedBy: 'monthlyPayments', cascade: ['persist',])]
private ?Tenants $tenant = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $periodStart = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $periodEnd = null;
#[ORM\ManyToMany(targetEntity: Utilities::class, inversedBy: 'monthlyPayments'),]
private Collection $utilities;
#[ORM\Column(length: 255, nullable: true)]
private ?string $tenantBills = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $totalBills = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $difference = null;
#[ORM\OneToMany(mappedBy: 'monthlyPayment', targetEntity: PaymentDoc::class, cascade: ['persist', ])]
private Collection $paymentDocs;
public function __construct()
{
$this->utilities = new ArrayCollection();
$this->paymentDocs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getAmountPaid(): ?string
{
return $this->amountPaid;
}
public function setAmountPaid(?string $amountPaid): self
{
$this->amountPaid = $amountPaid;
return $this;
}
public function getProperty(): ?PropertyList
{
return $this->property;
}
public function setProperty(?PropertyList $property): self
{
$this->property = $property;
return $this;
}
public function getTenant(): ?Tenants
{
return $this->tenant;
}
public function setTenant(?Tenants $tenant): self
{
$this->tenant = $tenant;
return $this;
}
public function getPeriodStart(): ?\DateTimeInterface
{
return $this->periodStart;
}
public function setPeriodStart(?\DateTimeInterface $periodStart): self
{
$this->periodStart = $periodStart;
return $this;
}
public function getPeriodEnd(): ?\DateTimeInterface
{
return $this->periodEnd;
}
public function setPeriodEnd(?\DateTimeInterface $periodEnd): self
{
$this->periodEnd = $periodEnd;
return $this;
}
/**
* @return Collection<int, Utilities>
*/
public function getUtilities(): Collection
{
return $this->utilities;
}
public function addUtility(Utilities $utility): self
{
if (!$this->utilities->contains($utility)) {
$this->utilities->add($utility);
}
return $this;
}
public function removeUtility(Utilities $utility): self
{
$this->utilities->removeElement($utility);
return $this;
}
public function getTenantBills(): ?string
{
return $this->tenantBills;
}
public function setTenantBills(?string $tenantBills): self
{
$this->tenantBills = $tenantBills;
return $this;
}
public function getTotalBills(): ?string
{
return $this->totalBills;
}
public function setTotalBills(?string $totalBills): self
{
$this->totalBills = $totalBills;
return $this;
}
public function getDifference(): ?string
{
return $this->difference;
}
public function setDifference(?string $difference): self
{
$this->difference = $difference;
return $this;
}
/**
* @return Collection<int, PaymentDoc>
*/
public function getPaymentDocs(): Collection
{
return $this->paymentDocs;
}
public function addPaymentDoc(PaymentDoc $paymentDoc): self
{
if (!$this->paymentDocs->contains($paymentDoc)) {
$this->paymentDocs->add($paymentDoc);
$paymentDoc->setMonthlyPayment($this);
}
return $this;
}
public function removePaymentDoc(PaymentDoc $paymentDoc): self
{
if ($this->paymentDocs->removeElement($paymentDoc)) {
// set the owning side to null (unless already changed)
if ($paymentDoc->getMonthlyPayment() === $this) {
$paymentDoc->setMonthlyPayment(null);
}
}
return $this;
}
}