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

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