| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Billing;
- use ApiPlatform\Core\Annotation\ApiResource;
- use App\Entity\Access\Access;
- use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\Collection;
- /**
- * Enregistrement d'un produit à facturer par un Access
- */
- #[Auditable]
- #[ApiResource]
- #[ORM\Entity(repositoryClass: AccessIntangible::class)]
- class AccessIntangible extends AbstractBillingIntangible
- {
- #[ORM\ManyToOne(inversedBy: 'accessIntangibles')]
- private ?Access $access = null;
- #[ORM\OneToMany(mappedBy: 'accessIntangible', targetEntity: BillingIntangibleExcludeDate::class, cascade: ['persist'], orphanRemoval: true)]
- private Collection $billingIntangibleExcludeDates;
- public function __construct()
- {
- $this->billingIntangibleExcludeDates = new ArrayCollection();
- }
- public function setAccess(?Access $access): self
- {
- $this->access = $access;
- return $this;
- }
- public function getAccess(): ?Access
- {
- return $this->access;
- }
- /**
- * @return Collection<int, BillingIntangibleExcludeDate>
- */
- public function getBillingIntangibleExcludeDates(): Collection
- {
- return $this->billingIntangibleExcludeDates;
- }
- public function addBillingIntangibleExcludeDate(BillingIntangibleExcludeDate $billingIntangibleExcludeDate): self
- {
- if (!$this->billingIntangibleExcludeDates->contains($billingIntangibleExcludeDate)) {
- $this->billingIntangibleExcludeDates[] = $billingIntangibleExcludeDate;
- $billingIntangibleExcludeDate->setAccessIntangible($this);
- }
- return $this;
- }
- public function removeBillingIntangibleExcludeDate(BillingIntangibleExcludeDate $billingIntangibleExcludeDate): self
- {
- if ($this->billingIntangibleExcludeDates->removeElement($billingIntangibleExcludeDate)) {
- // set the owning side to null (unless already changed)
- if ($billingIntangibleExcludeDate->getAccessIntangible() === $this) {
- $billingIntangibleExcludeDate->setAccessIntangible(null);
- }
- }
- return $this;
- }
- }
|