| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Booking;
- use ApiPlatform\Metadata\ApiResource;
- use App\Entity\Access\Access;
- // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use App\Entity\Core\Tagg;
- use App\Entity\Organization\Organization;
- use App\Entity\Product\Equipment;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @todo : A la suite de la migration, il faut supprimer le nom de la table pour avoir une table PersonHoliday, et supprimer l'attribut discr.
- *
- * Périodes de vacances d'un Access
- */
- #[ApiResource(operations: [])]
- // #[Auditable]
- #[ORM\Entity]
- class PersonHoliday extends AbstractBooking
- {
- #[ORM\ManyToOne(inversedBy: 'holidays')]
- private ?Access $access = null;
- #[ORM\ManyToOne(targetEntity: Organization::class, cascade: [])]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'SET NULL')]
- protected Organization $organization;
- /** @var Collection<int, PersonHolidayRecur> */
- #[ORM\OneToMany(targetEntity: PersonHolidayRecur::class, mappedBy: 'event', cascade: ['persist'], orphanRemoval: true)]
- protected Collection $eventRecur;
- public function getAccess(): ?Access
- {
- return $this->access;
- }
- public function setAccess(?Access $access): self
- {
- $this->access = $access;
- return $this;
- }
- public function getOrganization(): Organization
- {
- return $this->organization;
- }
- public function setOrganization(Organization $organization): self
- {
- $this->organization = $organization;
- return $this;
- }
- public function getOrganizer(): Collection
- {
- return $this->organizer;
- }
- public function addOrganizer(Access $organizer): self
- {
- $this->organizer[] = $organizer;
- return $this;
- }
- public function removeOrganizer(Access $organizer): self
- {
- $this->organizer->removeElement($organizer);
- return $this;
- }
- }
|