<?php
namespace App\Entity;
use App\Repository\DefautRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DefautRepository::class)]
class Defaut 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\ManyToOne(targetEntity: DefautCategorie::class, inversedBy: 'defauts')]
private $categorie;
#[ORM\OneToMany(targetEntity: DefautParFamille::class, mappedBy: 'defaut')]
private $defautParFamilles;
#[ORM\OneToMany(targetEntity: FicheQualiteDefaut::class, mappedBy: 'defaut')]
private $ficheQualiteDefauts;
#[ORM\OneToMany(targetEntity: FicheQualiteAtelierAuditeurDefaut::class, mappedBy: 'defaut')]
private $ficheQualiteAtelierAuditeurDefauts;
#[ORM\OneToMany(targetEntity: FicheQualiteAtelierDefaut::class, mappedBy: 'defaut')]
private $ficheQualiteAtelierDefauts;
#[ORM\OneToMany(targetEntity: FicheQualiteCentDefaut::class, mappedBy: 'defaut')]
private $ficheQualiteCentDefauts;
#[ORM\OneToMany(targetEntity: FicheQualiteChoixDefaut::class, mappedBy: 'yes')]
private $ficheQualiteChoixDefauts;
#[ORM\OneToMany(targetEntity: FicheReparation::class, mappedBy: 'defaut')]
private $ficheReparations;
#[ORM\OneToMany(targetEntity: FicheControleEnCoursDefaut::class, mappedBy: 'defaut')]
private $ficheControleEnCoursDefauts;
#[ORM\OneToMany(targetEntity: Derogation::class, mappedBy: 'defaut')]
private $derogations;
#[ORM\OneToMany(targetEntity: DerogationSynthese::class, mappedBy: 'defaut')]
private $derogationSyntheses;
public function __construct()
{
$this->defautParFamilles = new ArrayCollection();
$this->ficheQualiteDefauts = new ArrayCollection();
$this->ficheQualiteAtelierAuditeurDefauts = new ArrayCollection();
$this->ficheQualiteAtelierDefauts = new ArrayCollection();
$this->ficheQualiteCentDefauts = new ArrayCollection();
$this->ficheQualiteChoixDefauts = new ArrayCollection();
$this->ficheReparations = new ArrayCollection();
$this->ficheControleEnCoursDefauts = new ArrayCollection();
$this->derogations = new ArrayCollection();
$this->derogationSyntheses = new ArrayCollection();
}
public function __toString(): string{
return (string) $this->name;
}
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 getCategorie(): ?DefautCategorie
{
return $this->categorie;
}
public function setCategorie(?DefautCategorie $categorie): self
{
$this->categorie = $categorie;
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->setDefaut($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->getDefaut() === $this) {
$defautParFamille->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection|FicheQualiteDefaut[]
*/
public function getFicheQualiteDefauts(): Collection
{
return $this->ficheQualiteDefauts;
}
public function addFicheQualiteDefaut(FicheQualiteDefaut $ficheQualiteDefaut): self
{
if (!$this->ficheQualiteDefauts->contains($ficheQualiteDefaut)) {
$this->ficheQualiteDefauts[] = $ficheQualiteDefaut;
$ficheQualiteDefaut->setDefaut($this);
}
return $this;
}
public function removeFicheQualiteDefaut(FicheQualiteDefaut $ficheQualiteDefaut): self
{
if ($this->ficheQualiteDefauts->removeElement($ficheQualiteDefaut)) {
// set the owning side to null (unless already changed)
if ($ficheQualiteDefaut->getDefaut() === $this) {
$ficheQualiteDefaut->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection|FicheQualiteAtelierAuditeurDefaut[]
*/
public function getFicheQualiteAtelierAuditeurDefauts(): Collection
{
return $this->ficheQualiteAtelierAuditeurDefauts;
}
public function addFicheQualiteAtelierAuditeurDefaut(FicheQualiteAtelierAuditeurDefaut $ficheQualiteAtelierAuditeurDefaut): self
{
if (!$this->ficheQualiteAtelierAuditeurDefauts->contains($ficheQualiteAtelierAuditeurDefaut)) {
$this->ficheQualiteAtelierAuditeurDefauts[] = $ficheQualiteAtelierAuditeurDefaut;
$ficheQualiteAtelierAuditeurDefaut->setDefaut($this);
}
return $this;
}
public function removeFicheQualiteAtelierAuditeurDefaut(FicheQualiteAtelierAuditeurDefaut $ficheQualiteAtelierAuditeurDefaut): self
{
if ($this->ficheQualiteAtelierAuditeurDefauts->removeElement($ficheQualiteAtelierAuditeurDefaut)) {
// set the owning side to null (unless already changed)
if ($ficheQualiteAtelierAuditeurDefaut->getDefaut() === $this) {
$ficheQualiteAtelierAuditeurDefaut->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection|FicheQualiteAtelierDefaut[]
*/
public function getFicheQualiteAtelierDefauts(): Collection
{
return $this->ficheQualiteAtelierDefauts;
}
public function addFicheQualiteAtelierDefaut(FicheQualiteAtelierDefaut $ficheQualiteAtelierDefaut): self
{
if (!$this->ficheQualiteAtelierDefauts->contains($ficheQualiteAtelierDefaut)) {
$this->ficheQualiteAtelierDefauts[] = $ficheQualiteAtelierDefaut;
$ficheQualiteAtelierDefaut->setDefaut($this);
}
return $this;
}
public function removeFicheQualiteAtelierDefaut(FicheQualiteAtelierDefaut $ficheQualiteAtelierDefaut): self
{
if ($this->ficheQualiteAtelierDefauts->removeElement($ficheQualiteAtelierDefaut)) {
// set the owning side to null (unless already changed)
if ($ficheQualiteAtelierDefaut->getDefaut() === $this) {
$ficheQualiteAtelierDefaut->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection|FicheQualiteCentDefaut[]
*/
public function getFicheQualiteCentDefauts(): Collection
{
return $this->ficheQualiteCentDefauts;
}
public function addFicheQualiteCentDefaut(FicheQualiteCentDefaut $ficheQualiteCentDefaut): self
{
if (!$this->ficheQualiteCentDefauts->contains($ficheQualiteCentDefaut)) {
$this->ficheQualiteCentDefauts[] = $ficheQualiteCentDefaut;
$ficheQualiteCentDefaut->setDefaut($this);
}
return $this;
}
public function removeFicheQualiteCentDefaut(FicheQualiteCentDefaut $ficheQualiteCentDefaut): self
{
if ($this->ficheQualiteCentDefauts->removeElement($ficheQualiteCentDefaut)) {
// set the owning side to null (unless already changed)
if ($ficheQualiteCentDefaut->getDefaut() === $this) {
$ficheQualiteCentDefaut->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection<int, FicheQualiteChoixDefaut>
*/
public function getFicheQualiteChoixDefauts(): Collection
{
return $this->ficheQualiteChoixDefauts;
}
public function addFicheQualiteChoixDefaut(FicheQualiteChoixDefaut $ficheQualiteChoixDefaut): self
{
if (!$this->ficheQualiteChoixDefauts->contains($ficheQualiteChoixDefaut)) {
$this->ficheQualiteChoixDefauts[] = $ficheQualiteChoixDefaut;
$ficheQualiteChoixDefaut->setYes($this);
}
return $this;
}
public function removeFicheQualiteChoixDefaut(FicheQualiteChoixDefaut $ficheQualiteChoixDefaut): self
{
if ($this->ficheQualiteChoixDefauts->removeElement($ficheQualiteChoixDefaut)) {
// set the owning side to null (unless already changed)
if ($ficheQualiteChoixDefaut->getYes() === $this) {
$ficheQualiteChoixDefaut->setYes(null);
}
}
return $this;
}
/**
* @return Collection<int, FicheReparation>
*/
public function getFicheReparations(): Collection
{
return $this->ficheReparations;
}
public function addFicheReparation(FicheReparation $ficheReparation): self
{
if (!$this->ficheReparations->contains($ficheReparation)) {
$this->ficheReparations[] = $ficheReparation;
$ficheReparation->setDefaut($this);
}
return $this;
}
public function removeFicheReparation(FicheReparation $ficheReparation): self
{
if ($this->ficheReparations->removeElement($ficheReparation)) {
// set the owning side to null (unless already changed)
if ($ficheReparation->getDefaut() === $this) {
$ficheReparation->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection<int, FicheControleEnCoursDefaut>
*/
public function getFicheControleEnCoursDefauts(): Collection
{
return $this->ficheControleEnCoursDefauts;
}
public function addFicheControleEnCoursDefaut(FicheControleEnCoursDefaut $ficheControleEnCoursDefaut): self
{
if (!$this->ficheControleEnCoursDefauts->contains($ficheControleEnCoursDefaut)) {
$this->ficheControleEnCoursDefauts[] = $ficheControleEnCoursDefaut;
$ficheControleEnCoursDefaut->setDefaut($this);
}
return $this;
}
public function removeFicheControleEnCoursDefaut(FicheControleEnCoursDefaut $ficheControleEnCoursDefaut): self
{
if ($this->ficheControleEnCoursDefauts->removeElement($ficheControleEnCoursDefaut)) {
// set the owning side to null (unless already changed)
if ($ficheControleEnCoursDefaut->getDefaut() === $this) {
$ficheControleEnCoursDefaut->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection<int, Derogation>
*/
public function getDerogations(): Collection
{
return $this->derogations;
}
public function addDerogation(Derogation $derogation): self
{
if (!$this->derogations->contains($derogation)) {
$this->derogations[] = $derogation;
$derogation->setDefaut($this);
}
return $this;
}
public function removeDerogation(Derogation $derogation): self
{
if ($this->derogations->removeElement($derogation)) {
// set the owning side to null (unless already changed)
if ($derogation->getDefaut() === $this) {
$derogation->setDefaut(null);
}
}
return $this;
}
/**
* @return Collection<int, DerogationSynthese>
*/
public function getDerogationSyntheses(): Collection
{
return $this->derogationSyntheses;
}
public function addDerogationSynthesis(DerogationSynthese $derogationSynthesis): self
{
if (!$this->derogationSyntheses->contains($derogationSynthesis)) {
$this->derogationSyntheses[] = $derogationSynthesis;
$derogationSynthesis->setDefaut($this);
}
return $this;
}
public function removeDerogationSynthesis(DerogationSynthese $derogationSynthesis): self
{
if ($this->derogationSyntheses->removeElement($derogationSynthesis)) {
// set the owning side to null (unless already changed)
if ($derogationSynthesis->getDefaut() === $this) {
$derogationSynthesis->setDefaut(null);
}
}
return $this;
}
}