<?php
namespace App\Entity;
use App\Repository\LMSCategoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LMSCategoryRepository::class)
*/
class LMSCategory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\OneToMany(targetEntity=LMSFormation::class, mappedBy="lmsCategory")
*/
private $lmsFormations;
public function __construct()
{
$this->lmsFormations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* @return Collection<int, LMSFormation>
*/
public function getLmsFormations(): Collection
{
return $this->lmsFormations;
}
public function addLmsFormation(LMSFormation $lmsFormation): self
{
if (!$this->lmsFormations->contains($lmsFormation)) {
$this->lmsFormations[] = $lmsFormation;
$lmsFormation->setLmsCategory($this);
}
return $this;
}
public function removeLmsFormation(LMSFormation $lmsFormation): self
{
if ($this->lmsFormations->removeElement($lmsFormation)) {
// set the owning side to null (unless already changed)
if ($lmsFormation->getLmsCategory() === $this) {
$lmsFormation->setLmsCategory(null);
}
}
return $this;
}
}