<?php
namespace App\Entity;
use App\Repository\StatutQualiteRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StatutQualiteRepository::class)]
class StatutQualite implements \Stringable
{
#[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: FicheQualite::class, mappedBy: 'statut')]
private $ficheQualites;
public function __construct()
{
$this->ficheQualites = 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;
}
public function __toString(): string
{
return (string) $this->name;
}
/**
* @return Collection|FicheQualite[]
*/
public function getFicheQualites(): Collection
{
return $this->ficheQualites;
}
public function addFicheQualite(FicheQualite $ficheQualite): self
{
if (!$this->ficheQualites->contains($ficheQualite)) {
$this->ficheQualites[] = $ficheQualite;
$ficheQualite->setStatut($this);
}
return $this;
}
public function removeFicheQualite(FicheQualite $ficheQualite): self
{
if ($this->ficheQualites->removeElement($ficheQualite)) {
// set the owning side to null (unless already changed)
if ($ficheQualite->getStatut() === $this) {
$ficheQualite->setStatut(null);
}
}
return $this;
}
}