<?php
namespace App\Entity;
use App\Repository\CriticiteRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CriticiteRepository::class)]
class Criticite
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name_en;
#[ORM\OneToMany(targetEntity: DefautParFamille::class, mappedBy: 'criticite')]
private $defautParFamilles;
public function __construct()
{
$this->defautParFamilles = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getNameEn(): ?string
{
return $this->name_en;
}
public function setNameEn(?string $name_en): self
{
$this->name_en = $name_en;
return $this;
}
/**
* @return Collection|DefautParFamille[]
*/
public function getDefautParFamilles(): Collection
{
return $this->defautParFamilles;
}
public function addDefautParFamille(DefautParFamille $defautParFamille): self
{
if (!$this->defautParFamilles->contains($defautParFamille)) {
$this->defautParFamilles[] = $defautParFamille;
$defautParFamille->setCriticite($this);
}
return $this;
}
public function removeDefautParFamille(DefautParFamille $defautParFamille): self
{
if ($this->defautParFamilles->removeElement($defautParFamille)) {
// set the owning side to null (unless already changed)
if ($defautParFamille->getCriticite() === $this) {
$defautParFamille->setCriticite(null);
}
}
return $this;
}
}