<?php
namespace App\Entity;
use App\Repository\CategorieFormationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CategorieFormationRepository::class)
*/
class CategorieFormation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $wording;
/**
* @ORM\OneToMany(targetEntity=Formation::class, mappedBy="categorieformation")
*/
private $formations;
public function __construct()
{
$this->formations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->wording;
}
public function setWording(string $wording): self
{
$this->wording = $wording;
return $this;
}
/**
* @return Collection<int, Formation>
*/
public function getFormations(): Collection
{
return $this->formations;
}
public function addFormation(Formation $formation): self
{
if (!$this->formations->contains($formation)) {
$this->formations[] = $formation;
$formation->setCategorieformation($this);
}
return $this;
}
public function removeFormation(Formation $formation): self
{
if ($this->formations->removeElement($formation)) {
// set the owning side to null (unless already changed)
if ($formation->getCategorieformation() === $this) {
$formation->setCategorieformation(null);
}
}
return $this;
}
}