<?php
namespace App\Entity\Gestiform\Formations\Session\Planning;
use App\Entity\AbstractEntity;
use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
use App\Repository\Gestiform\Formations\Session\AccompagnementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AccompagnementRepository::class)
*/
class Accompagnement extends AbstractEntity
{
/**
* @ORM\OneToMany(targetEntity=Event::class, mappedBy="accompagnement")
*/
private Collection $events;
/**
* @ORM\ManyToOne(targetEntity=Masterlistelg::class)
*/
private Masterlistelg $type;
/**
* @ORM\Column(type="boolean")
*/
private bool $tempsPriseEnCompte = true;
/**
* @ORM\Column(type="boolean")
*/
private bool $allDay = true;
/**
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTimeInterface $start = null;
/**
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTimeInterface $end = null;
public function __construct()
{
$this->events = new ArrayCollection();
}
public function getEvents(): Collection
{
return $this->events;
}
public function addEvent(Event $event): self
{
if (!$this->events->contains($event)) {
$this->events->add($event);
$event->setAccompagnement($this);
}
return $this;
}
public function removeEvent(Event $event): self
{
if ($this->events->removeElement($event)) {
// set the owning side to null (unless already changed)
if ($event->getAccompagnement() === $this) {
$event->setAccompagnement(null);
}
}
return $this;
}
public function getType(): Masterlistelg
{
return $this->type;
}
public function setType(Masterlistelg $type): self
{
$this->type = $type;
return $this;
}
public function isTempsPriseEnCompte(): bool
{
return $this->tempsPriseEnCompte;
}
public function setTempsPriseEnCompte(bool $tempsPriseEnCompte): self
{
$this->tempsPriseEnCompte = $tempsPriseEnCompte;
return $this;
}
public function isAllDay(): bool
{
return $this->allDay;
}
public function setAllDay(bool $allDay): self
{
$this->allDay = $allDay;
return $this;
}
public function getStart(): ?\DateTimeInterface
{
return $this->start;
}
public function setStart(?\DateTimeInterface $start): self
{
$this->start = $start;
return $this;
}
public function getEnd(): ?\DateTimeInterface
{
return $this->end;
}
public function setEnd(?\DateTimeInterface $end): self
{
$this->end = $end;
return $this;
}
}