src/Entity/Gestiform/Formations/Session/Planning/Accompagnement.php line 15

  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Session\Planning;
  3. use DateTimeInterface;
  4. use App\Entity\AbstractEntity;
  5. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  6. use App\Repository\Gestiform\Formations\Session\AccompagnementRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassAccompagnementRepository::class)]
  11. class Accompagnement extends AbstractEntity
  12. {
  13.     #[ORM\OneToMany(mappedBy'accompagnement'targetEntityEvent::class)]
  14.     private Collection $events;
  15.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  16.     private Masterlistelg $type;
  17.     #[ORM\Column(type'boolean')]
  18.     private bool $tempsPriseEnCompte true;
  19.     #[ORM\Column(type'boolean')]
  20.     private bool $allDay true;
  21.     #[ORM\Column(type'time'nullabletrue)]
  22.     private ?DateTimeInterface $start null;
  23.     #[ORM\Column(type'time'nullabletrue)]
  24.     private ?DateTimeInterface $end null;
  25.     public function __construct()
  26.     {
  27.         $this->events = new ArrayCollection();
  28.     }
  29.     public function getEvents(): Collection
  30.     {
  31.         return $this->events;
  32.     }
  33.     public function addEvent(Event $event): self
  34.     {
  35.         if (!$this->events->contains($event)) {
  36.             $this->events->add($event);
  37.             $event->setAccompagnement($this);
  38.         }
  39.         return $this;
  40.     }
  41.     public function removeEvent(Event $event): self
  42.     {
  43.         // set the owning side to null (unless already changed)
  44.         if ($this->events->removeElement($event) && $event->getAccompagnement() === $this) {
  45.             $event->setAccompagnement(null);
  46.         }
  47.         return $this;
  48.     }
  49.     public function getType(): Masterlistelg
  50.     {
  51.         return $this->type;
  52.     }
  53.     public function setType(Masterlistelg $type): self
  54.     {
  55.         $this->type $type;
  56.         return $this;
  57.     }
  58.     public function isTempsPriseEnCompte(): bool
  59.     {
  60.         return $this->tempsPriseEnCompte;
  61.     }
  62.     public function setTempsPriseEnCompte(bool $tempsPriseEnCompte): self
  63.     {
  64.         $this->tempsPriseEnCompte $tempsPriseEnCompte;
  65.         return $this;
  66.     }
  67.     public function isAllDay(): bool
  68.     {
  69.         return $this->allDay;
  70.     }
  71.     public function setAllDay(bool $allDay): self
  72.     {
  73.         $this->allDay $allDay;
  74.         return $this;
  75.     }
  76.     public function getStart(): ?DateTimeInterface
  77.     {
  78.         return $this->start;
  79.     }
  80.     public function setStart(?DateTimeInterface $start): self
  81.     {
  82.         $this->start $start;
  83.         return $this;
  84.     }
  85.     public function getEnd(): ?DateTimeInterface
  86.     {
  87.         return $this->end;
  88.     }
  89.     public function setEnd(?DateTimeInterface $end): self
  90.     {
  91.         $this->end $end;
  92.         return $this;
  93.     }
  94. }