src/Entity/Gestiform/Formations/Session/Planning/PlanningEvent.php line 16
<?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\JoinColumn(nullable: false)]
#[ORM\ManyToOne(targetEntity: Event::class, cascade: ['persist'], inversedBy: 'planningEvents')]
private Event $event;
#[ORM\JoinColumn(nullable: false)]
#[ORM\ManyToOne(targetEntity: Planning::class, inversedBy: 'planningEvents')]
private Planning $planning;
#[ORM\JoinColumn(nullable: true)]
#[ORM\ManyToOne(targetEntity: SalleEvent::class, inversedBy: 'planningEvents')]
private ?SalleEvent $salleEvent=null;
#[ORM\OneToOne(mappedBy: 'planningEvent', targetEntity: ApprenantLivrable::class, cascade: ['persist'])]
private ?ApprenantLivrable $apprenantLivrable=null;
#[ORM\OneToMany(mappedBy: 'stage', targetEntity: Convention::class, 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
{
// set the owning side to null (unless already changed)
if ($this->conventions->removeElement($convention) && $convention->getStage() === $this) {
$convention->setStage(null);
}
return $this;
}
}