src/Entity/DefautCategorie.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DefautCategorieRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDefautCategorieRepository::class)]
  8. class DefautCategorie implements \Stringable
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $name;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $name_en;
  18.     #[ORM\OneToMany(targetEntityDefaut::class, mappedBy'categorie')]
  19.     private $defauts;
  20.     #[ORM\ManyToMany(targetEntityCategorieFamille::class, mappedBy'categoriesdefaut')]
  21.     private $categorieFamilles;
  22.     #[ORM\OneToMany(targetEntityFicheQualiteDefaut::class, mappedBy'defaut_categorie'cascade: ['persist''remove'])]
  23.     private $ficheQualiteDefauts;
  24.     #[ORM\OneToMany(targetEntityFicheQualiteAtelierAuditeurDefaut::class, mappedBy'defaut_categorie')]
  25.     private $ficheQualiteAtelierAuditeurDefauts;
  26.     #[ORM\OneToMany(targetEntityFicheQualiteAtelierDefaut::class, mappedBy'defaut_categorie')]
  27.     private $ficheQualiteAtelierDefauts;
  28.     #[ORM\OneToMany(targetEntityFicheQualiteCentDefaut::class, mappedBy'defaut_categorie')]
  29.     private $ficheQualiteCentDefauts;
  30.     public function __construct()
  31.     {
  32.         $this->defauts = new ArrayCollection();
  33.         $this->categorieFamilles = new ArrayCollection();
  34.         $this->ficheQualiteDefauts = new ArrayCollection();
  35.         $this->ficheQualiteAtelierAuditeurDefauts = new ArrayCollection();
  36.         $this->ficheQualiteAtelierDefauts = new ArrayCollection();
  37.         $this->ficheQualiteCentDefauts = new ArrayCollection();
  38.     }
  39.     public function __toString(): string{
  40.         return (string) $this->name;
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getName(): ?string
  47.     {
  48.         return $this->name;
  49.     }
  50.     public function setName(?string $name): self
  51.     {
  52.         $this->name $name;
  53.         return $this;
  54.     }
  55.     public function getNameEn(): ?string
  56.     {
  57.         return $this->name_en;
  58.     }
  59.     public function setNameEn(?string $name_en): self
  60.     {
  61.         $this->name_en $name_en;
  62.         return $this;
  63.     }
  64.     /**
  65.      * @return Collection|Defaut[]
  66.      */
  67.     public function getDefauts(): Collection
  68.     {
  69.         return $this->defauts;
  70.     }
  71.     public function addDefaut(Defaut $defaut): self
  72.     {
  73.         if (!$this->defauts->contains($defaut)) {
  74.             $this->defauts[] = $defaut;
  75.             $defaut->setCategorie($this);
  76.         }
  77.         return $this;
  78.     }
  79.     public function removeDefaut(Defaut $defaut): self
  80.     {
  81.         if ($this->defauts->removeElement($defaut)) {
  82.             // set the owning side to null (unless already changed)
  83.             if ($defaut->getCategorie() === $this) {
  84.                 $defaut->setCategorie(null);
  85.             }
  86.         }
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return Collection|CategorieFamille[]
  91.      */
  92.     public function getCategorieFamilles(): Collection
  93.     {
  94.         return $this->categorieFamilles;
  95.     }
  96.     public function addCategorieFamille(CategorieFamille $categorieFamille): self
  97.     {
  98.         if (!$this->categorieFamilles->contains($categorieFamille)) {
  99.             $this->categorieFamilles[] = $categorieFamille;
  100.             $categorieFamille->addCategoriesdefaut($this);
  101.         }
  102.         return $this;
  103.     }
  104.     public function removeCategorieFamille(CategorieFamille $categorieFamille): self
  105.     {
  106.         if ($this->categorieFamilles->removeElement($categorieFamille)) {
  107.             $categorieFamille->removeCategoriesdefaut($this);
  108.         }
  109.         return $this;
  110.     }
  111.     /**
  112.      * @return Collection|FicheQualiteDefaut[]
  113.      */
  114.     public function getFicheQualiteDefauts(): Collection
  115.     {
  116.         return $this->ficheQualiteDefauts;
  117.     }
  118.     public function addFicheQualiteDefaut(FicheQualiteDefaut $ficheQualiteDefaut): self
  119.     {
  120.         if (!$this->ficheQualiteDefauts->contains($ficheQualiteDefaut)) {
  121.             $this->ficheQualiteDefauts[] = $ficheQualiteDefaut;
  122.             $ficheQualiteDefaut->setDefautCategorie($this);
  123.         }
  124.         return $this;
  125.     }
  126.     public function removeFicheQualiteDefaut(FicheQualiteDefaut $ficheQualiteDefaut): self
  127.     {
  128.         if ($this->ficheQualiteDefauts->removeElement($ficheQualiteDefaut)) {
  129.             // set the owning side to null (unless already changed)
  130.             if ($ficheQualiteDefaut->getDefautCategorie() === $this) {
  131.                 $ficheQualiteDefaut->setDefautCategorie(null);
  132.             }
  133.         }
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return Collection|FicheQualiteAtelierAuditeurDefaut[]
  138.      */
  139.     public function getFicheQualiteAtelierAuditeurDefauts(): Collection
  140.     {
  141.         return $this->ficheQualiteAtelierAuditeurDefauts;
  142.     }
  143.     public function addFicheQualiteAtelierAuditeurDefaut(FicheQualiteAtelierAuditeurDefaut $ficheQualiteAtelierAuditeurDefaut): self
  144.     {
  145.         if (!$this->ficheQualiteAtelierAuditeurDefauts->contains($ficheQualiteAtelierAuditeurDefaut)) {
  146.             $this->ficheQualiteAtelierAuditeurDefauts[] = $ficheQualiteAtelierAuditeurDefaut;
  147.             $ficheQualiteAtelierAuditeurDefaut->setDefautCategorie($this);
  148.         }
  149.         return $this;
  150.     }
  151.     public function removeFicheQualiteAtelierAuditeurDefaut(FicheQualiteAtelierAuditeurDefaut $ficheQualiteAtelierAuditeurDefaut): self
  152.     {
  153.         if ($this->ficheQualiteAtelierAuditeurDefauts->removeElement($ficheQualiteAtelierAuditeurDefaut)) {
  154.             // set the owning side to null (unless already changed)
  155.             if ($ficheQualiteAtelierAuditeurDefaut->getDefautCategorie() === $this) {
  156.                 $ficheQualiteAtelierAuditeurDefaut->setDefautCategorie(null);
  157.             }
  158.         }
  159.         return $this;
  160.     }
  161.     /**
  162.      * @return Collection|FicheQualiteAtelierDefaut[]
  163.      */
  164.     public function getFicheQualiteAtelierDefauts(): Collection
  165.     {
  166.         return $this->ficheQualiteAtelierDefauts;
  167.     }
  168.     public function addFicheQualiteAtelierDefaut(FicheQualiteAtelierDefaut $ficheQualiteAtelierDefaut): self
  169.     {
  170.         if (!$this->ficheQualiteAtelierDefauts->contains($ficheQualiteAtelierDefaut)) {
  171.             $this->ficheQualiteAtelierDefauts[] = $ficheQualiteAtelierDefaut;
  172.             $ficheQualiteAtelierDefaut->setDefautCategorie($this);
  173.         }
  174.         return $this;
  175.     }
  176.     public function removeFicheQualiteAtelierDefaut(FicheQualiteAtelierDefaut $ficheQualiteAtelierDefaut): self
  177.     {
  178.         if ($this->ficheQualiteAtelierDefauts->removeElement($ficheQualiteAtelierDefaut)) {
  179.             // set the owning side to null (unless already changed)
  180.             if ($ficheQualiteAtelierDefaut->getDefautCategorie() === $this) {
  181.                 $ficheQualiteAtelierDefaut->setDefautCategorie(null);
  182.             }
  183.         }
  184.         return $this;
  185.     }
  186.     /**
  187.      * @return Collection|FicheQualiteCentDefaut[]
  188.      */
  189.     public function getFicheQualiteCentDefauts(): Collection
  190.     {
  191.         return $this->ficheQualiteCentDefauts;
  192.     }
  193.     public function addFicheQualiteCentDefaut(FicheQualiteCentDefaut $ficheQualiteCentDefaut): self
  194.     {
  195.         if (!$this->ficheQualiteCentDefauts->contains($ficheQualiteCentDefaut)) {
  196.             $this->ficheQualiteCentDefauts[] = $ficheQualiteCentDefaut;
  197.             $ficheQualiteCentDefaut->setDefautCategorie($this);
  198.         }
  199.         return $this;
  200.     }
  201.     public function removeFicheQualiteCentDefaut(FicheQualiteCentDefaut $ficheQualiteCentDefaut): self
  202.     {
  203.         if ($this->ficheQualiteCentDefauts->removeElement($ficheQualiteCentDefaut)) {
  204.             // set the owning side to null (unless already changed)
  205.             if ($ficheQualiteCentDefaut->getDefautCategorie() === $this) {
  206.                 $ficheQualiteCentDefaut->setDefautCategorie(null);
  207.             }
  208.         }
  209.         return $this;
  210.     }
  211. }