|
@@ -64,6 +64,10 @@ class Examen extends AbstractBooking
|
|
|
#[ORM\OneToMany(targetEntity: AttendanceBooking::class, mappedBy: 'examen', cascade: ['persist', 'remove'])]
|
|
#[ORM\OneToMany(targetEntity: AttendanceBooking::class, mappedBy: 'examen', cascade: ['persist', 'remove'])]
|
|
|
protected Collection $attendanceBooking;
|
|
protected Collection $attendanceBooking;
|
|
|
|
|
|
|
|
|
|
+ /** @var Collection<int, Presence> */
|
|
|
|
|
+ #[ORM\OneToMany(targetEntity: Presence::class, mappedBy: 'examen', cascade: ['persist', 'remove'])]
|
|
|
|
|
+ protected Collection $presences;
|
|
|
|
|
+
|
|
|
#[ORM\ManyToOne(inversedBy: 'examens')]
|
|
#[ORM\ManyToOne(inversedBy: 'examens')]
|
|
|
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
|
|
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
|
|
|
protected ?Place $place;
|
|
protected ?Place $place;
|
|
@@ -78,6 +82,7 @@ class Examen extends AbstractBooking
|
|
|
$this->educationCurriculum = new ArrayCollection();
|
|
$this->educationCurriculum = new ArrayCollection();
|
|
|
$this->convocation = new ArrayCollection();
|
|
$this->convocation = new ArrayCollection();
|
|
|
$this->attendanceBooking = new ArrayCollection();
|
|
$this->attendanceBooking = new ArrayCollection();
|
|
|
|
|
+ $this->presences = new ArrayCollection();
|
|
|
parent::__construct();
|
|
parent::__construct();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -341,6 +346,35 @@ class Examen extends AbstractBooking
|
|
|
public function removeTag(Tagg $tag): self
|
|
public function removeTag(Tagg $tag): self
|
|
|
{
|
|
{
|
|
|
$this->tags->removeElement($tag);
|
|
$this->tags->removeElement($tag);
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return Collection<int, Presence>
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getPresences(): Collection
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->presences;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addPresence(Presence $presence): self
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->presences->contains($presence)) {
|
|
|
|
|
+ $this->presences[] = $presence;
|
|
|
|
|
+ $presence->setExamen($this);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removePresence(Presence $presence): self
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->presences->removeElement($presence)) {
|
|
|
|
|
+ // set the owning side to null (unless already changed)
|
|
|
|
|
+ if ($presence->getExamen() === $this) {
|
|
|
|
|
+ $presence->setExamen(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|