<?php
namespace App\Entity\Gestiform\Formations\Session\Planning;
use App\Entity\AbstractEntity;
use App\Entity\Common\Convention;
use App\Entity\Gestiform\Formations\Session\SalleEvent;
use App\Repository\Gestiform\Formations\Session\Planning\PlanningEventRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PlanningEventRepository::class)
*/
class PlanningEvent extends AbstractEntity
{
/**
* @ORM\ManyToOne(targetEntity=Event::class, inversedBy="planningEvents",cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private Event $event;
/**
* @ORM\ManyToOne(targetEntity=Planning::class, inversedBy="planningEvents")
* @ORM\JoinColumn(nullable=false)
*/
private Planning $planning;
/**
* @ORM\ManyToOne(targetEntity=SalleEvent::class, inversedBy="planningEvents")
* @ORM\JoinColumn(nullable=true)
*/
private ?SalleEvent $salleEvent=null;
/**
* @ORM\OneToOne(targetEntity=ApprenantLivrable::class, mappedBy="planningEvent", cascade={"persist"})
*/
private ?ApprenantLivrable $apprenantLivrable=null;
/**
* @ORM\OneToMany(targetEntity=Convention::class, mappedBy="stage", cascade={"persist", "remove"})
*/
private Collection $conventions;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $sendconvocation = null;
public function __construct()
{
$this->conventions = new ArrayCollection();
}
public function getPlanning(): Planning
{
return $this->planning;
}
public function setPlanning(Planning $planning): self
{
$this->planning = $planning;
return $this;
}
public function getEvent(): Event
{
return $this->event;
}
public function setEvent(Event $event): self
{
$this->event = $event;
return $this;
}
public function getSalleEvent(): ?SalleEvent
{
return $this->salleEvent;
}
public function setSalleEvent(?SalleEvent $salleEvent): self
{
$this->salleEvent = $salleEvent;
return $this;
}
public function getApprenantLivrable(): ?ApprenantLivrable
{
return $this->apprenantLivrable;
}
public function setApprenantLivrable(?ApprenantLivrable $apprenantLivrable): self
{
$this->apprenantLivrable = $apprenantLivrable;
return $this;
}
public function getSendconvocation(): ?bool
{
return $this->sendconvocation;
}
public function setSendconvocation(?bool $sendconvocation): self
{
$this->sendconvocation = $sendconvocation;
return $this;
}
public function isSendconvocation(): ?bool
{
return $this->sendconvocation;
}
/**
* @return Collection<int, Convention>
*/
public function getConventions(): Collection
{
return $this->conventions;
}
public function addConvention(Convention $convention): static
{
if (!$this->conventions->contains($convention)) {
$this->conventions->add($convention);
$convention->setStage($this);
}
return $this;
}
public function removeConvention(Convention $convention): static
{
if ($this->conventions->removeElement($convention)) {
// set the owning side to null (unless already changed)
if ($convention->getStage() === $this) {
$convention->setStage(null);
}
}
return $this;
}
}