src/Entity/Gestiform/Formations/Session/Planning/Jury.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\Gestiform\Formations\Catalogue\Parcours\Parcours;
  5. use App\Entity\Gestiform\Formations\Session\Session;
  6. use App\Repository\Gestiform\Formations\Session\JuryRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11.  * @ORM\Entity(repositoryClass=JuryRepository::class)
  12.  */
  13. class Jury extends AbstractEntity
  14. {
  15.     /**
  16.      * @ORM\Column(type="string", nullable=true)
  17.      * THIS IS A DUMMY FIELD BECAUSE JURY CLASS IS EMPTY FOR NOW IF YOU ADD SOME FIELDS THAT CAN BE ADDED TO JURYTYPE YOU CAN DELETE THIS FIELD
  18.      */
  19.     private ?string $dummyField null;
  20.     /**
  21.      * @ORM\Column(type="boolean", nullable=true)
  22.      */
  23.     private ?bool $president false;
  24.     /**
  25.      * @ORM\OneToMany(targetEntity=Event::class, mappedBy="jury", cascade={"persist"})
  26.      */
  27.     private Collection $events;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=Parcours::class)
  30.      */
  31.     private ?Parcours $parcours null;
  32.     public function __construct()
  33.     {
  34.         $this->events = new ArrayCollection();
  35.     }
  36.     public function getEvents(): Collection
  37.     {
  38.         return $this->events;
  39.     }
  40.     public function addEvent(Event $event): self
  41.     {
  42.         if (!$this->events->contains($event)) {
  43.             $this->events->add($event);
  44.             $event->setJury($this);
  45.         }
  46.         return $this;
  47.     }
  48.     public function removeEvent(Event $event): self
  49.     {
  50.         if ($this->events->removeElement($event)) {
  51.             // set the owning side to null (unless already changed)
  52.             if ($event->getJury() === $this) {
  53.                 $event->setJury(null);
  54.             }
  55.         }
  56.         return $this;
  57.     }
  58.     public function getDummyField(): ?string
  59.     {
  60.         return $this->dummyField;
  61.     }
  62.     public function setDummyField(?string $dummyField): self
  63.     {
  64.         $this->dummyField $dummyField;
  65.         return $this;
  66.     }
  67.     public function getParcours(): ?Parcours
  68.     {
  69.         return $this->parcours;
  70.     }
  71.     public function setParcours(?Parcours $parcours): self
  72.     {
  73.         $this->parcours $parcours;
  74.         return $this;
  75.     }
  76.     public function isPresident(): ?bool
  77.     {
  78.         return $this->president;
  79.     }
  80.     public function setPresident(?bool $president): Jury
  81.     {
  82.         $this->president $president;
  83.         return $this;
  84.     }
  85. }