src/Entity/Gestiform/Formations/Session/Planning/PlanningEvent.php line 16

  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Session\Planning;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Convention;
  5. use App\Entity\Gestiform\Formations\Session\SalleEvent;
  6. use App\Repository\Gestiform\Formations\Session\Planning\PlanningEventRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassPlanningEventRepository::class)]
  11. class PlanningEvent extends AbstractEntity
  12. {
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     #[ORM\ManyToOne(targetEntityEvent::class, cascade: ['persist'], inversedBy'planningEvents')]
  15.     private Event $event;
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     #[ORM\ManyToOne(targetEntityPlanning::class, inversedBy'planningEvents')]
  18.     private Planning $planning;
  19.     #[ORM\JoinColumn(nullabletrue)]
  20.     #[ORM\ManyToOne(targetEntitySalleEvent::class, inversedBy'planningEvents')]
  21.     private ?SalleEvent $salleEvent=null;
  22.     #[ORM\OneToOne(mappedBy'planningEvent'targetEntityApprenantLivrable::class, cascade: ['persist'])]
  23.     private ?ApprenantLivrable $apprenantLivrable=null;
  24.     #[ORM\OneToMany(mappedBy'stage'targetEntityConvention::class, cascade: ['persist''remove'])]
  25.     private Collection $conventions;
  26.     #[ORM\Column(type'boolean'nullabletrue)]
  27.     private ?bool $sendconvocation null;
  28.     public function __construct()
  29.     {
  30.         $this->conventions = new ArrayCollection();
  31.     }
  32.     public function getPlanning(): Planning
  33.     {
  34.         return $this->planning;
  35.     }
  36.     public function setPlanning(Planning $planning): self
  37.     {
  38.         $this->planning $planning;
  39.         return $this;
  40.     }
  41.     public function getEvent(): Event
  42.     {
  43.         return $this->event;
  44.     }
  45.     public function setEvent(Event $event): self
  46.     {
  47.         $this->event $event;
  48.         return $this;
  49.     }
  50.     public function getSalleEvent(): ?SalleEvent
  51.     {
  52.         return $this->salleEvent;
  53.     }
  54.     public function setSalleEvent(?SalleEvent $salleEvent): self
  55.     {
  56.         $this->salleEvent $salleEvent;
  57.         return $this;
  58.     }
  59.     public function getApprenantLivrable(): ?ApprenantLivrable
  60.     {
  61.         return $this->apprenantLivrable;
  62.     }
  63.     public function setApprenantLivrable(?ApprenantLivrable $apprenantLivrable): self
  64.     {
  65.         $this->apprenantLivrable $apprenantLivrable;
  66.         return $this;
  67.     }
  68.     public function getSendconvocation(): ?bool
  69.     {
  70.         return $this->sendconvocation;
  71.     }
  72.     public function setSendconvocation(?bool $sendconvocation): self
  73.     {
  74.         $this->sendconvocation $sendconvocation;
  75.         return $this;
  76.     }
  77.     public function isSendconvocation(): ?bool
  78.     {
  79.         return $this->sendconvocation;
  80.     }
  81.     /**
  82.      * @return Collection<int, Convention>
  83.      */
  84.     public function getConventions(): Collection
  85.     {
  86.         return $this->conventions;
  87.     }
  88.     public function addConvention(Convention $convention): static
  89.     {
  90.         if (!$this->conventions->contains($convention)) {
  91.             $this->conventions->add($convention);
  92.             $convention->setStage($this);
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeConvention(Convention $convention): static
  97.     {
  98.         // set the owning side to null (unless already changed)
  99.         if ($this->conventions->removeElement($convention) && $convention->getStage() === $this) {
  100.             $convention->setStage(null);
  101.         }
  102.         return $this;
  103.     }
  104. }