| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Billing;
- // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use ApiPlatform\Metadata\ApiResource;
- use App\Entity\Core\File;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * TODO: documenter.
- */
- // #[Auditable]
- #[ApiResource(operations: [])]
- #[ORM\Entity]
- class SddBank
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- /** @var Collection<int, BillPayment> */
- #[ORM\OneToMany(targetEntity: BillPayment::class, mappedBy: 'sddBank', cascade: [], orphanRemoval: false)]
- protected Collection $billPayments;
- #[ORM\OneToOne(targetEntity: File::class, cascade: ['persist'])]
- protected ?File $file;
- public function __construct()
- {
- $this->billPayments = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getBillPayments(): Collection
- {
- return $this->billPayments;
- }
- public function addBillPayment(BillPayment $billPayment): self
- {
- if (!$this->billPayments->contains($billPayment)) {
- $this->billPayments[] = $billPayment;
- $billPayment->setSddBank($this);
- }
- return $this;
- }
- public function removeBillPayment(BillPayment $billPayment): self
- {
- if ($this->billPayments->removeElement($billPayment)) {
- // $billPayment->setSddBank(null); // TODO: actuellement, pas nullable: conserver?
- }
- return $this;
- }
- public function getFile(): ?File
- {
- return $this->file;
- }
- public function setFile(?File $file): self
- {
- $this->file = $file;
- return $this;
- }
- }
|