| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?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
- * // TODO: possible factoriser avec SddBank?
- */
- // #[Auditable]
- #[ApiResource(operations: [])]
- #[ORM\Entity]
- class SddRegie
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- /** @var Collection<int, BillPayment> */
- #[ORM\OneToMany(mappedBy: 'sddRegime', targetEntity: BillPayment::class, cascade: [], orphanRemoval: false)]
- protected Collection $billPayments;
- #[ORM\OneToOne(targetEntity: File::class, cascade: ['persist'])]
- protected ?File $file;
- #[ORM\OneToOne(targetEntity: File::class, cascade: ['persist'])]
- protected ?File $bordereau;
- 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->setSddRegie($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;
- }
- public function getBordereau(): ?File
- {
- return $this->bordereau;
- }
- public function setBordereau(?File $bordereau): self
- {
- $this->bordereau = $bordereau;
- return $this;
- }
- }
|