src/Entity/MonthlyPayments.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MonthlyPaymentsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassMonthlyPaymentsRepository::class)]
  9. class MonthlyPayments
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $amountPaid null;
  17.     #[ORM\ManyToOne(inversedBy'monthlyPayments'cascade: ['persist',])]
  18.     private ?PropertyList $property null;
  19.     #[ORM\ManyToOne(inversedBy'monthlyPayments'cascade: ['persist',])]
  20.     private ?Tenants $tenant null;
  21.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  22.     private ?\DateTimeInterface $periodStart null;
  23.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  24.     private ?\DateTimeInterface $periodEnd null;
  25.     #[ORM\ManyToMany(targetEntityUtilities::class, inversedBy'monthlyPayments'),]
  26.     private Collection $utilities;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $tenantBills null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $totalBills null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $difference null;
  33.     #[ORM\OneToMany(mappedBy'monthlyPayment'targetEntityPaymentDoc::class, cascade: ['persist', ])]
  34.     private Collection $paymentDocs;
  35.     public function __construct()
  36.     {
  37.         $this->utilities = new ArrayCollection();
  38.         $this->paymentDocs = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getAmountPaid(): ?string
  45.     {
  46.         return $this->amountPaid;
  47.     }
  48.     public function setAmountPaid(?string $amountPaid): self
  49.     {
  50.         $this->amountPaid $amountPaid;
  51.         return $this;
  52.     }
  53.     public function getProperty(): ?PropertyList
  54.     {
  55.         return $this->property;
  56.     }
  57.     public function setProperty(?PropertyList $property): self
  58.     {
  59.         $this->property $property;
  60.         return $this;
  61.     }
  62.     public function getTenant(): ?Tenants
  63.     {
  64.         return $this->tenant;
  65.     }
  66.     public function setTenant(?Tenants $tenant): self
  67.     {
  68.         $this->tenant $tenant;
  69.         return $this;
  70.     }
  71.     public function getPeriodStart(): ?\DateTimeInterface
  72.     {
  73.         return $this->periodStart;
  74.     }
  75.     public function setPeriodStart(?\DateTimeInterface $periodStart): self
  76.     {
  77.         $this->periodStart $periodStart;
  78.         return $this;
  79.     }
  80.     public function getPeriodEnd(): ?\DateTimeInterface
  81.     {
  82.         return $this->periodEnd;
  83.     }
  84.     public function setPeriodEnd(?\DateTimeInterface $periodEnd): self
  85.     {
  86.         $this->periodEnd $periodEnd;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return Collection<int, Utilities>
  91.      */
  92.     public function getUtilities(): Collection
  93.     {
  94.         return $this->utilities;
  95.     }
  96.     public function addUtility(Utilities $utility): self
  97.     {
  98.         if (!$this->utilities->contains($utility)) {
  99.             $this->utilities->add($utility);
  100.         }
  101.         return $this;
  102.     }
  103.     public function removeUtility(Utilities $utility): self
  104.     {
  105.         $this->utilities->removeElement($utility);
  106.         return $this;
  107.     }
  108.     public function getTenantBills(): ?string
  109.     {
  110.         return $this->tenantBills;
  111.     }
  112.     public function setTenantBills(?string $tenantBills): self
  113.     {
  114.         $this->tenantBills $tenantBills;
  115.         return $this;
  116.     }
  117.     public function getTotalBills(): ?string
  118.     {
  119.         return $this->totalBills;
  120.     }
  121.     public function setTotalBills(?string $totalBills): self
  122.     {
  123.         $this->totalBills $totalBills;
  124.         return $this;
  125.     }
  126.     public function getDifference(): ?string
  127.     {
  128.         return $this->difference;
  129.     }
  130.     public function setDifference(?string $difference): self
  131.     {
  132.         $this->difference $difference;
  133.         return $this;
  134.     }
  135.     /**
  136.      * @return Collection<int, PaymentDoc>
  137.      */
  138.     public function getPaymentDocs(): Collection
  139.     {
  140.         return $this->paymentDocs;
  141.     }
  142.     public function addPaymentDoc(PaymentDoc $paymentDoc): self
  143.     {
  144.         if (!$this->paymentDocs->contains($paymentDoc)) {
  145.             $this->paymentDocs->add($paymentDoc);
  146.             $paymentDoc->setMonthlyPayment($this);
  147.         }
  148.         return $this;
  149.     }
  150.     public function removePaymentDoc(PaymentDoc $paymentDoc): self
  151.     {
  152.         if ($this->paymentDocs->removeElement($paymentDoc)) {
  153.             // set the owning side to null (unless already changed)
  154.             if ($paymentDoc->getMonthlyPayment() === $this) {
  155.                 $paymentDoc->setMonthlyPayment(null);
  156.             }
  157.         }
  158.         return $this;
  159.     }
  160. }