|
|
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|
|
namespace App\Entity\Booking;
|
|
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
|
+use App\Entity\Access\Access;
|
|
|
use App\Entity\Billing\ResidenceArea;
|
|
|
use App\Entity\Core\Tagg;
|
|
|
use App\Entity\Education\Education;
|
|
|
@@ -12,8 +13,10 @@ use App\Entity\Education\EducationCurriculum;
|
|
|
use App\Entity\Organization\Jury;
|
|
|
use App\Entity\Organization\Organization;
|
|
|
use App\Entity\Place\AbstractPlace;
|
|
|
+use App\Entity\Place\Place;
|
|
|
use App\Entity\Place\Room;
|
|
|
// use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
|
|
|
+use App\Entity\Product\Equipment;
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
use Doctrine\Common\Collections\Collection;
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
@@ -53,7 +56,7 @@ class Examen extends AbstractBooking
|
|
|
protected Education $education;
|
|
|
|
|
|
/** @var Collection<int, EducationCurriculum> */
|
|
|
- #[ORM\ManyToMany(targetEntity: EducationCurriculum::class)]
|
|
|
+ #[ORM\ManyToMany(targetEntity: EducationCurriculum::class, inversedBy: 'examens', cascade: ['persist'])]
|
|
|
protected Collection $educationCurriculum;
|
|
|
|
|
|
/** @var Collection<int, ExamenConvocation> */
|
|
|
@@ -67,12 +70,18 @@ class Examen extends AbstractBooking
|
|
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'examens')]
|
|
|
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
|
|
|
- protected AbstractPlace $place;
|
|
|
+ protected Place $place;
|
|
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'examens')]
|
|
|
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
|
|
|
protected ?Room $room = null;
|
|
|
|
|
|
+ #[ORM\ManyToMany(targetEntity: Equipment::class, cascade: [], orphanRemoval: false)]
|
|
|
+ #[ORM\JoinTable(name: 'booking_equipment')]
|
|
|
+ #[ORM\JoinColumn(name: 'booking_id')]
|
|
|
+ #[ORM\InverseJoinColumn(name: 'equipment_id')]
|
|
|
+ protected Collection $equipments;
|
|
|
+
|
|
|
/** @var Collection<int, Tagg> */
|
|
|
#[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'examens', cascade: ['persist'])]
|
|
|
#[ORM\JoinTable(name: 'tag_booking')]
|
|
|
@@ -309,6 +318,59 @@ class Examen extends AbstractBooking
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
+ #[ORM\ManyToMany(targetEntity: Access::class, inversedBy: 'practicalCourses', cascade: [], orphanRemoval: false)]
|
|
|
+ #[ORM\JoinTable(name: 'booking_organizer')]
|
|
|
+ #[ORM\JoinColumn(name: 'booking_id')]
|
|
|
+ protected Collection $organizer;
|
|
|
+
|
|
|
+ function getOrganizer(): Collection
|
|
|
+ {
|
|
|
+ return $this->organizer;
|
|
|
+ }
|
|
|
+
|
|
|
+ function addOrganizer(Access $organizer): self
|
|
|
+ {
|
|
|
+ if (!$this->organizer->contains($organizer)) {
|
|
|
+ $this->organizer[] = $organizer;
|
|
|
+ $organizer->addPracticalCourse($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ function removeOrganizer(Access $organizer): self
|
|
|
+ {
|
|
|
+ if ($this->organizer->removeElement($organizer)) {
|
|
|
+ $organizer->removePracticalCourse($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getEquipments(): Collection
|
|
|
+ {
|
|
|
+ return $this->equipments;
|
|
|
+ }
|
|
|
+
|
|
|
+ function addEquipment(Equipment $equipment): self
|
|
|
+ {
|
|
|
+ if (!$this->equipments->contains($equipment)) {
|
|
|
+ $this->equipments[] = $equipment;
|
|
|
+// $equipment->addXXX($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ function removeEquipment(Equipment $equipment): self
|
|
|
+ {
|
|
|
+ if ($this->equipments->removeElement($equipment)) {
|
|
|
+// $equipment->removeXXXX($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @return Collection<int, Tagg>
|
|
|
*/
|