src/Entity/TotalDue.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TotalDueRepository;
  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. use Gedmo\Timestampable\Traits\TimestampableEntity;
  9. #[ORM\Entity(repositoryClassTotalDueRepository::class)]
  10. class TotalDue
  11. {
  12.     use TimestampableEntity;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne]
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     private ?User $user null;
  20.     #[ORM\Column]
  21.     private ?int $amtInPennies null;
  22.     #[ORM\ManyToOne]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     private ?PaymentPeriod $period null;
  25.     #[ORM\Column(nullabletrue)]
  26.     private ?bool $holdPayment null;
  27.     #[ORM\OneToMany(mappedBy'totalDue'targetEntityAggregatedCommissions::class)]
  28.     private Collection $aggregatedCommissions;
  29.     #[ORM\OneToMany(mappedBy'totalDue'targetEntityTrueUp::class)]
  30.     private Collection $trueUps;
  31.     #[ORM\ManyToOne(inversedBy'totalDues')]
  32.     #[ORM\JoinColumn(nullablefalse)]
  33.     private ?UserPaymentPeriod $userPaymentPeriod null;
  34.     public function __construct()
  35.     {
  36.         $this->aggregatedCommissions = new ArrayCollection();
  37.         $this->trueUps = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getUser(): ?User
  44.     {
  45.         return $this->user;
  46.     }
  47.     public function setUser(?User $user): self
  48.     {
  49.         $this->user $user;
  50.         return $this;
  51.     }
  52.     public function getAmtInPennies(): ?int
  53.     {
  54.         return $this->amtInPennies;
  55.     }
  56.     public function setAmtInPennies(int $amtInPennies): self
  57.     {
  58.         $this->amtInPennies $amtInPennies;
  59.         return $this;
  60.     }
  61.     public function getPeriod(): ?PaymentPeriod
  62.     {
  63.         return $this->period;
  64.     }
  65.     public function setPeriod(?PaymentPeriod $period): self
  66.     {
  67.         $this->period $period;
  68.         return $this;
  69.     }
  70.     public function isHoldPayment(): ?bool
  71.     {
  72.         return $this->holdPayment;
  73.     }
  74.     public function setHoldPayment(?bool $holdPayment): self
  75.     {
  76.         $this->holdPayment $holdPayment;
  77.         return $this;
  78.     }
  79.     /**
  80.      * @return Collection<int, AggregatedCommissions>
  81.      */
  82.     public function getAggregatedCommissions(): Collection
  83.     {
  84.         return $this->aggregatedCommissions;
  85.     }
  86.     public function addAggregatedCommission(AggregatedCommissions $aggregatedCommission): self
  87.     {
  88.         if (!$this->aggregatedCommissions->contains($aggregatedCommission)) {
  89.             $this->aggregatedCommissions->add($aggregatedCommission);
  90.             $aggregatedCommission->setTotalDue($this);
  91.         }
  92.         return $this;
  93.     }
  94.     public function removeAggregatedCommission(AggregatedCommissions $aggregatedCommission): self
  95.     {
  96.         if ($this->aggregatedCommissions->removeElement($aggregatedCommission)) {
  97.             // set the owning side to null (unless already changed)
  98.             if ($aggregatedCommission->getTotalDue() === $this) {
  99.                 $aggregatedCommission->setTotalDue(null);
  100.             }
  101.         }
  102.         return $this;
  103.     }
  104.     /**
  105.      * @return Collection<int, TrueUp>
  106.      */
  107.     public function getTrueUps(): Collection
  108.     {
  109.         return $this->trueUps;
  110.     }
  111.     public function addTrueUp(TrueUp $trueUp): self
  112.     {
  113.         if (!$this->trueUps->contains($trueUp)) {
  114.             $this->trueUps->add($trueUp);
  115.             $trueUp->setTotalDue($this);
  116.         }
  117.         return $this;
  118.     }
  119.     public function removeTrueUp(TrueUp $trueUp): self
  120.     {
  121.         if ($this->trueUps->removeElement($trueUp)) {
  122.             // set the owning side to null (unless already changed)
  123.             if ($trueUp->getTotalDue() === $this) {
  124.                 $trueUp->setTotalDue(null);
  125.             }
  126.         }
  127.         return $this;
  128.     }
  129.     public function getUserPaymentPeriod(): ?UserPaymentPeriod
  130.     {
  131.         return $this->userPaymentPeriod;
  132.     }
  133.     public function setUserPaymentPeriod(?UserPaymentPeriod $userPaymentPeriod): self
  134.     {
  135.         $this->userPaymentPeriod $userPaymentPeriod;
  136.         return $this;
  137.     }
  138. }