src/Entity/UserPaymentPeriod.php line 14
<?phpnamespace App\Entity;use App\Enum\CustomerClass;use App\Enum\RegionEnum;use App\Repository\UserPaymentPeriodRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: UserPaymentPeriodRepository::class)]class UserPaymentPeriod{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'userPaymentPeriods', cascade: ['REMOVE'])]#[ORM\JoinColumn(nullable: false)]private ?PaymentPeriod $paymentPeriod = null;#[ORM\ManyToOne(inversedBy: 'userPaymentPeriods')]#[ORM\JoinColumn(nullable: false)]private ?User $user = null;#[ORM\OneToMany(mappedBy: 'userPaymentPeriod', targetEntity: Order::class, cascade: ['REMOVE'])]private Collection $orders;#[ORM\OneToMany(mappedBy: 'userPaymentPeriod', targetEntity: CreditResult::class, cascade: ['REMOVE'])]private Collection $creditResults;#[ORM\OneToMany(mappedBy: 'userPaymentPeriod', targetEntity: CommissionResult::class, cascade: ['REMOVE'])]private Collection $commissionResults;#[ORM\OneToMany(mappedBy: 'userPaymentPeriod', targetEntity: AggregatedCommissions::class, cascade: ['REMOVE'])]private Collection $aggregatedCommissions;#[ORM\OneToMany(mappedBy: 'userPaymentPeriod', targetEntity: TrueUp::class, cascade: ['REMOVE'])]private Collection $trueUps;#[ORM\OneToMany(mappedBy: 'userPaymentPeriod', targetEntity: TotalDue::class, cascade: ['REMOVE'])]private Collection $totalDues;public function __construct(){$this->orders = new ArrayCollection();$this->creditResults = new ArrayCollection();$this->commissionResults = new ArrayCollection();$this->aggregatedCommissions = new ArrayCollection();$this->guaranteePayments = new ArrayCollection();$this->trueUps = new ArrayCollection();$this->totalDues = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getPaymentPeriod(): ?PaymentPeriod{return $this->paymentPeriod;}public function setPaymentPeriod(?PaymentPeriod $paymentPeriod): self{$this->paymentPeriod = $paymentPeriod;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): self{$this->user = $user;return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setUserPaymentPeriod($this);}return $this;}public function removeOrder(Order $order): self{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getUserPaymentPeriod() === $this) {$order->setUserPaymentPeriod(null);}}return $this;}/*** @return Collection<int, CreditResult>*/public function getCreditResults(): Collection{return $this->creditResults;}public function addCreditResult(CreditResult $creditResult): self{if (!$this->creditResults->contains($creditResult)) {$this->creditResults->add($creditResult);$creditResult->setUserPaymentPeriod($this);}return $this;}public function removeCreditResult(CreditResult $creditResult): self{if ($this->creditResults->removeElement($creditResult)) {// set the owning side to null (unless already changed)if ($creditResult->getUserPaymentPeriod() === $this) {$creditResult->setUserPaymentPeriod(null);}}return $this;}/*** @return Collection<int, CommissionResult>*/public function getCommissionResults(): Collection{return $this->commissionResults;}public function addCommissionResult(CommissionResult $commissionResult): self{if (!$this->commissionResults->contains($commissionResult)) {$this->commissionResults->add($commissionResult);$commissionResult->setUserPaymentPeriod($this);}return $this;}public function removeCommissionResult(CommissionResult $commissionResult): self{if ($this->commissionResults->removeElement($commissionResult)) {// set the owning side to null (unless already changed)if ($commissionResult->getUserPaymentPeriod() === $this) {$commissionResult->setUserPaymentPeriod(null);}}return $this;}/*** @return Collection<int, AggregatedCommissions>*/public function getAggregatedCommissions(): Collection{return $this->aggregatedCommissions;}public function addAggregatedCommission(AggregatedCommissions $aggregatedCommission): self{if (!$this->aggregatedCommissions->contains($aggregatedCommission)) {$this->aggregatedCommissions->add($aggregatedCommission);$aggregatedCommission->setUserPaymentPeriod($this);}return $this;}public function removeAggregatedCommission(AggregatedCommissions $aggregatedCommission): self{if ($this->aggregatedCommissions->removeElement($aggregatedCommission)) {// set the owning side to null (unless already changed)if ($aggregatedCommission->getUserPaymentPeriod() === $this) {$aggregatedCommission->setUserPaymentPeriod(null);}}return $this;}/*** @return Collection<int, TrueUp>*/public function getTrueUps(): Collection{return $this->trueUps;}public function addTrueUp(TrueUp $trueUp): self{if (!$this->trueUps->contains($trueUp)) {$this->trueUps->add($trueUp);$trueUp->setUserPaymentPeriod($this);}return $this;}public function removeTrueUp(TrueUp $trueUp): self{if ($this->trueUps->removeElement($trueUp)) {// set the owning side to null (unless already changed)if ($trueUp->getUserPaymentPeriod() === $this) {$trueUp->setUserPaymentPeriod(null);}}return $this;}/*** @return Collection<int, TotalDue>*/public function getTotalDues(): Collection{return $this->totalDues;}public function addTotalDue(TotalDue $totalDue): self{if (!$this->totalDues->contains($totalDue)) {$this->totalDues->add($totalDue);$totalDue->setUserPaymentPeriod($this);}return $this;}public function removeTotalDue(TotalDue $totalDue): self{if ($this->totalDues->removeElement($totalDue)) {// set the owning side to null (unless already changed)if ($totalDue->getUserPaymentPeriod() === $this) {$totalDue->setUserPaymentPeriod(null);}}return $this;}public function __toString(){return $this->user . ' ' . $this->paymentPeriod;}}