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

Open in your IDE?
  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. /**
  11.  * @ORM\Entity(repositoryClass=PlanningEventRepository::class)
  12.  */
  13. class PlanningEvent extends AbstractEntity
  14. {
  15.     /**
  16.      * @ORM\ManyToOne(targetEntity=Event::class, inversedBy="planningEvents",cascade={"persist"})
  17.      * @ORM\JoinColumn(nullable=false)
  18.      */
  19.     private Event $event;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=Planning::class, inversedBy="planningEvents")
  22.      * @ORM\JoinColumn(nullable=false)
  23.      */
  24.     private Planning $planning;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=SalleEvent::class, inversedBy="planningEvents")
  27.      * @ORM\JoinColumn(nullable=true)
  28.      */
  29.     private ?SalleEvent $salleEvent=null;
  30.     /**
  31.      * @ORM\OneToOne(targetEntity=ApprenantLivrable::class, mappedBy="planningEvent",  cascade={"persist"})
  32.      */
  33.     private ?ApprenantLivrable $apprenantLivrable=null;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Convention::class, mappedBy="stage", cascade={"persist", "remove"})
  36.      */
  37.     private Collection $conventions;
  38.     /**
  39.     * @ORM\Column(type="boolean", nullable=true)
  40.     */
  41.     private ?bool $sendconvocation null;
  42.     public function __construct()
  43.     {
  44.         $this->conventions = new ArrayCollection();
  45.     }
  46.     public function getPlanning(): Planning
  47.     {
  48.         return $this->planning;
  49.     }
  50.     public function setPlanning(Planning $planning): self
  51.     {
  52.         $this->planning $planning;
  53.         return $this;
  54.     }
  55.     public function getEvent(): Event
  56.     {
  57.         return $this->event;
  58.     }
  59.     public function setEvent(Event $event): self
  60.     {
  61.         $this->event $event;
  62.         return $this;
  63.     }
  64.     public function getSalleEvent(): ?SalleEvent
  65.     {
  66.         return $this->salleEvent;
  67.     }
  68.     public function setSalleEvent(?SalleEvent $salleEvent): self
  69.     {
  70.         $this->salleEvent $salleEvent;
  71.         return $this;
  72.     }
  73.     public function getApprenantLivrable(): ?ApprenantLivrable
  74.     {
  75.         return $this->apprenantLivrable;
  76.     }
  77.     public function setApprenantLivrable(?ApprenantLivrable $apprenantLivrable): self
  78.     {
  79.         $this->apprenantLivrable $apprenantLivrable;
  80.         return $this;
  81.     }
  82.     public function getSendconvocation(): ?bool
  83.     {
  84.         return $this->sendconvocation;
  85.     }
  86.     public function setSendconvocation(?bool $sendconvocation): self
  87.     {
  88.         $this->sendconvocation $sendconvocation;
  89.         return $this;
  90.     }
  91.     public function isSendconvocation(): ?bool
  92.     {
  93.         return $this->sendconvocation;
  94.     }
  95.     /**
  96.      * @return Collection<int, Convention>
  97.      */
  98.     public function getConventions(): Collection
  99.     {
  100.         return $this->conventions;
  101.     }
  102.     public function addConvention(Convention $convention): static
  103.     {
  104.         if (!$this->conventions->contains($convention)) {
  105.             $this->conventions->add($convention);
  106.             $convention->setStage($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeConvention(Convention $convention): static
  111.     {
  112.         if ($this->conventions->removeElement($convention)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($convention->getStage() === $this) {
  115.                 $convention->setStage(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }
  120. }