src/Entity/Gestiform/Formations/Session/SalleEvent.php line 17
<?php
namespace App\Entity\Gestiform\Formations\Session;
use App\Entity\AbstractEntity;
use App\Entity\Gestiform\Admin\Salle;
use App\Entity\Gestiform\Formations\Session\Planning\Event;
use App\Entity\Gestiform\Formations\Session\Planning\PlanningEvent;
use App\Repository\Gestiform\Formations\Session\SalleEventRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SalleEventRepository::class)]
class SalleEvent extends AbstractEntity
{
#[ORM\JoinColumn(nullable: false)]
#[ORM\ManyToOne(targetEntity: Salle::class, inversedBy: 'salleEvents')]
private Salle $salle;
#[ORM\JoinColumn(nullable: false)]
#[ORM\ManyToOne(targetEntity: Event::class, inversedBy: 'salleEvents')]
private Event $event;
#[ORM\OneToMany(mappedBy: 'salleEvent', targetEntity: PlanningEvent::class)]
private Collection $planningEvents;
public function __construct()
{
$this->planningEvents = new ArrayCollection();
}
public function getSalle(): Salle
{
return $this->salle;
}
public function setSalle(Salle $salle): self
{
$this->salle = $salle;
return $this;
}
public function getEvent(): Event
{
return $this->event;
}
public function setEvent(Event $event): self
{
$this->event = $event;
return $this;
}
public function getPlanningEvents(): Collection
{
return $this->planningEvents;
}
public function addPlanningEvent(PlanningEvent $planningEvent): self
{
if (!$this->planningEvents->contains($planningEvent)) {
$this->planningEvents[] = $planningEvent;
$planningEvent->setSalleEvent($this);
}
return $this;
}
public function removePlanningEvent(PlanningEvent $planningEvent): self
{
// set the owning side to null (unless already changed)
if ($this->planningEvents->removeElement($planningEvent) && $planningEvent->getSalleEvent() === $this) {
$planningEvent->setSalleEvent(null);
}
return $this;
}
}