<?php
namespace App\Entity;
use App\Repository\FormationsSessionsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FormationsSessionsRepository::class)
*/
class FormationsSessions
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $label;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\ManyToOne(targetEntity=Formations::class, inversedBy="sessions")
*/
private $formation;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $startingDate;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $endDate;
/**
* @ORM\OneToMany(targetEntity=Registrations::class, mappedBy="session")
*/
private $registrations;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isEnabled;
public function __construct()
{
$this->registrations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(?string $label): self
{
$this->label = $label;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getFormation(): ?Formations
{
return $this->formation;
}
public function setFormation(?Formations $formation): self
{
$this->formation = $formation;
return $this;
}
public function getStartingDate(): ?\DateTimeInterface
{
return $this->startingDate;
}
public function setStartingDate(?\DateTimeInterface $startingDate): self
{
$this->startingDate = $startingDate;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(?\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
/**
* @return Collection<int, Registrations>
*/
public function getRegistrations(): Collection
{
return $this->registrations;
}
public function addRegistration(Registrations $registration): self
{
if (!$this->registrations->contains($registration)) {
$this->registrations[] = $registration;
$registration->setSession($this);
}
return $this;
}
public function removeRegistration(Registrations $registration): self
{
if ($this->registrations->removeElement($registration)) {
// set the owning side to null (unless already changed)
if ($registration->getSession() === $this) {
$registration->setSession(null);
}
}
return $this;
}
public function getIsEnabled(): ?bool
{
return $this->isEnabled;
}
public function setIsEnabled(?bool $isEnabled): self
{
$this->isEnabled = $isEnabled;
return $this;
}
}