src/Entity/FormationsSessions.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FormationsSessionsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FormationsSessionsRepository::class)
  9.  */
  10. class FormationsSessions
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true)
  20.      */
  21.     private $label;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Formations::class, inversedBy="sessions")
  28.      */
  29.     private $formation;
  30.     /**
  31.      * @ORM\Column(type="date", nullable=true)
  32.      */
  33.     private $startingDate;
  34.     /**
  35.      * @ORM\Column(type="date", nullable=true)
  36.      */
  37.     private $endDate;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=Registrations::class, mappedBy="session")
  40.      */
  41.     private $registrations;
  42.     /**
  43.      * @ORM\Column(type="boolean", nullable=true)
  44.      */
  45.     private $isEnabled;
  46.     public function __construct()
  47.     {
  48.         $this->registrations = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getLabel(): ?string
  55.     {
  56.         return $this->label;
  57.     }
  58.     public function setLabel(?string $label): self
  59.     {
  60.         $this->label $label;
  61.         return $this;
  62.     }
  63.     public function getDescription(): ?string
  64.     {
  65.         return $this->description;
  66.     }
  67.     public function setDescription(?string $description): self
  68.     {
  69.         $this->description $description;
  70.         return $this;
  71.     }
  72.     public function getFormation(): ?Formations
  73.     {
  74.         return $this->formation;
  75.     }
  76.     public function setFormation(?Formations $formation): self
  77.     {
  78.         $this->formation $formation;
  79.         return $this;
  80.     }
  81.     public function getStartingDate(): ?\DateTimeInterface
  82.     {
  83.         return $this->startingDate;
  84.     }
  85.     public function setStartingDate(?\DateTimeInterface $startingDate): self
  86.     {
  87.         $this->startingDate $startingDate;
  88.         return $this;
  89.     }
  90.     public function getEndDate(): ?\DateTimeInterface
  91.     {
  92.         return $this->endDate;
  93.     }
  94.     public function setEndDate(?\DateTimeInterface $endDate): self
  95.     {
  96.         $this->endDate $endDate;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection<int, Registrations>
  101.      */
  102.     public function getRegistrations(): Collection
  103.     {
  104.         return $this->registrations;
  105.     }
  106.     public function addRegistration(Registrations $registration): self
  107.     {
  108.         if (!$this->registrations->contains($registration)) {
  109.             $this->registrations[] = $registration;
  110.             $registration->setSession($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeRegistration(Registrations $registration): self
  115.     {
  116.         if ($this->registrations->removeElement($registration)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($registration->getSession() === $this) {
  119.                 $registration->setSession(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     public function getIsEnabled(): ?bool
  125.     {
  126.         return $this->isEnabled;
  127.     }
  128.     public function setIsEnabled(?bool $isEnabled): self
  129.     {
  130.         $this->isEnabled $isEnabled;
  131.         return $this;
  132.     }
  133. }