| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Billing;
- use App\Entity\Core\Tagg;
- use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Classe ... qui ...
- */
- #[Auditable]
- #[ORM\Entity]
- class BillPayment
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'billPayments')]
- #[ORM\JoinColumn(nullable: true)]
- private BillAccounting $bill;
- #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'billDetachedPayments')]
- #[ORM\JoinColumn(nullable: true)]
- private AccessBilling $accessBilling;
- #[ORM\OneToMany(mappedBy: 'billPayment',targetEntity: BillDebitBalance::class, cascade: ['persist'], orphanRemoval: true)]
- #[ORM\JoinColumn(nullable: true)]
- private Collection $billDebitBalances;
- #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'accountBalanceReimbursements')]
- #[ORM\JoinColumn(nullable: true)]
- private AccessBilling $accessBillingAccountBalanceReimbursement;
- #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'payments', cascade: ['persist'])]
- #[ORM\JoinTable(name: 'tag_billPayment')]
- #[ORM\JoinColumn(name: 'billPayment_id', referencedColumnName: 'id')]
- #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
- private $tags;
- public function __construct()
- {
- $this->billDebitBalances = new ArrayCollection();
- $this->tags = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getBill(): ?BillAccounting
- {
- return $this->bill;
- }
- public function setBill(?BillAccounting $bill): self
- {
- $this->bill = $bill;
- return $this;
- }
- public function getAccessBilling(): ?AccessBilling
- {
- return $this->accessBilling;
- }
- public function setAccessBilling(?AccessBilling $accessBilling): self
- {
- $this->accessBilling = $accessBilling;
- return $this;
- }
- /**
- * @return Collection<int, BillDebitBalance>
- */
- public function getBillDebitBalances(): Collection
- {
- return $this->billDebitBalances;
- }
- public function addBillDebitBalance(BillDebitBalance $billDebitBalance): self
- {
- if (!$this->billDebitBalances->contains($billDebitBalance)) {
- $this->billDebitBalances[] = $billDebitBalance;
- $billDebitBalance->setBillPayment($this);
- }
- return $this;
- }
- public function removeBillDebitBalance(BillDebitBalance $billDebitBalance): self
- {
- if ($this->billDebitBalances->removeElement($billDebitBalance)) {
- // set the owning side to null (unless already changed)
- if ($billDebitBalance->getBillPayment() === $this) {
- $billDebitBalance->setBillPayment(null);
- }
- }
- return $this;
- }
- public function getAccessBillingAccountBalanceReimbursement(): ?AccessBilling
- {
- return $this->accessBillingAccountBalanceReimbursement;
- }
- public function setAccessBillingAccountBalanceReimbursement(?AccessBilling $accessBillingAccountBalanceReimbursement): self
- {
- $this->accessBillingAccountBalanceReimbursement = $accessBillingAccountBalanceReimbursement;
- return $this;
- }
- /**
- * @return Collection<int, Tagg>
- */
- public function getTags(): Collection
- {
- return $this->tags;
- }
- public function addTag(Tagg $tag): self
- {
- if (!$this->tags->contains($tag)) {
- $this->tags[] = $tag;
- }
- return $this;
- }
- public function removeTag(Tagg $tag): self
- {
- $this->tags->removeElement($tag);
- return $this;
- }
- }
|