| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Billing;
- use ApiPlatform\Metadata\ApiResource;
- use App\Entity\Core\File;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- #[ApiResource(operations: [])]
- #[ORM\Entity]
- class CirilCivil
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private int $id;
- #[ORM\OneToMany(mappedBy: 'cirilCivil', targetEntity: Bill::class, cascade: ['persist'], orphanRemoval: true)]
- protected Collection $bills;
- #[ORM\OneToOne(targetEntity: File::class, cascade: ['persist'])]
- protected File $file;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getBills(): Collection
- {
- return $this->bills;
- }
- public function addBill(Bill $bill): self
- {
- if (!$this->bills->contains($bill)) {
- $this->bills[] = $bill;
- $bill->setCirilCivil($this);
- }
- return $this;
- }
- public function removeBill(Bill $bill): self
- {
- $this->bills->removeElement($bill);
- return $this;
- }
- public function getFile(): File
- {
- return $this->file;
- }
- public function setFile(File $file): self
- {
- $this->file = $file;
- return $this;
- }
- }
|