| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Billing;
- // 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 Jvs
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\OneToMany(mappedBy: 'jvs', targetEntity: AbstractBill::class, cascade: ['persist'], orphanRemoval: true)]
- private Collection $bills;
- public function __construct()
- {
- $this->bills = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- /**
- * @return Collection<int, AbstractBill>
- */
- public function getBills(): Collection
- {
- return $this->bills;
- }
- public function addBill(AbstractBill $bill): self
- {
- if (!$this->bills->contains($bill)) {
- $this->bills[] = $bill;
- $bill->setJvs($this);
- }
- return $this;
- }
- public function removeBill(AbstractBill $bill): self
- {
- if ($this->bills->removeElement($bill)) {
- // set the owning side to null (unless already changed)
- if ($bill->getJvs() === $this) {
- $bill->setJvs(null);
- }
- }
- return $this;
- }
- }
|