src/Entity/FichePreserie.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FichePreserieRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassFichePreserieRepository::class)]
  8. class FichePreserie 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 $reference;
  16.     #[ORM\ManyToOne(targetEntityCategorieMetier::class, inversedBy'fichePreseries')]
  17.     private $categorie;
  18.     #[ORM\ManyToOne(targetEntitySouscategorieMetier::class, inversedBy'fichePreseries')]
  19.     private $souscategorie;
  20.     #[ORM\Column(type'integer'nullabletrue)]
  21.     private $version;
  22.     #[ORM\Column(type'datetime'nullabletrue)]
  23.     private $date_creation;
  24.     #[ORM\Column(type'datetime'nullabletrue)]
  25.     private $date_update;
  26.     #[ORM\OneToMany(targetEntityFicheControlePreserie::class, mappedBy'fichepreserie')]
  27.     private $ficheControlePreseries;
  28.     #[ORM\ManyToOne(targetEntityAtelier::class, inversedBy'fichePreseries')]
  29.     private $atelier;
  30.     #[ORM\Column(type'boolean'nullabletrue)]
  31.     private int $cotraitance 0;
  32.     #[ORM\OneToMany(targetEntityFichePreserieOperation::class, mappedBy'fichepreserie'cascade: ['persist''remove'])]
  33.     private $operations;
  34.     #[ORM\OneToMany(targetEntityFichePreserieCoupe::class, mappedBy'preserie'cascade: ['persist''remove'])]
  35.     private $fichePreserieCoupes;
  36.     #[ORM\OneToMany(targetEntityFicheQualite::class, mappedBy'fichepreserie'cascade: ['persist''remove'])]
  37.     private $ficheQualites;
  38.     #[ORM\OneToMany(targetEntityFicheQualiteAtelierAuditeur::class, mappedBy'fichepreserie'cascade: ['persist''remove'])]
  39.     private $ficheQualiteAtelierAuditeurs;
  40.     #[ORM\OneToMany(targetEntityFicheQualiteSynthese::class, mappedBy'fiche_preserie'cascade: ['persist''remove'])]
  41.     private $ficheQualiteSyntheses;
  42.     #[ORM\OneToMany(targetEntityFicheQualiteAtelier::class, mappedBy'fichepreserie'cascade: ['persist''remove'])]
  43.     private $ficheQualiteAteliers;
  44.     #[ORM\OneToMany(targetEntityFicheQualiteCent::class, mappedBy'fichepreserie'cascade: ['persist''remove'])]
  45.     private $ficheQualiteCents;
  46.     public function __construct()
  47.     {
  48.         $this->date_creation = new \DateTime();
  49.         $this->date_update = new \DateTime();
  50.         $this->ficheControlePreseries = new ArrayCollection();
  51.         $this->operations = new ArrayCollection();
  52.         $this->fichePreserieCoupes = new ArrayCollection();
  53.         $this->ficheQualites = new ArrayCollection();
  54.         $this->ficheQualiteAtelierAuditeurs = new ArrayCollection();
  55.         $this->ficheQualiteSyntheses = new ArrayCollection();
  56.         $this->ficheQualiteAteliers = new ArrayCollection();
  57.         $this->ficheQualiteCents = new ArrayCollection();
  58.     }
  59.     public function __clone()
  60.     {
  61.        if ($this->id) {
  62.             $this->id null;
  63.                                                                                     
  64.             $operationsCloneCollection = new ArrayCollection();                   
  65.             foreach ($this->operations as $operation) {                             
  66.                 $operationClone = clone $operation
  67.                 $operationClone->setFichepreserie($this);                             
  68.                 $operationsCloneCollection->add($operationClone);                   
  69.             }                                                               
  70.             $this->operations $operationsCloneCollection
  71.             return $this;
  72.         }
  73.     }
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getReference(): ?string
  79.     {
  80.         return $this->reference;
  81.     }
  82.     public function setReference(?string $reference): self
  83.     {
  84.         $this->reference $reference;
  85.         return $this;
  86.     }
  87.     public function getCategorie(): ?CategorieMetier
  88.     {
  89.         return $this->categorie;
  90.     }
  91.     public function setCategorie(?CategorieMetier $categorie): self
  92.     {
  93.         $this->categorie $categorie;
  94.         return $this;
  95.     }
  96.     public function getSouscategorie(): ?SouscategorieMetier
  97.     {
  98.         return $this->souscategorie;
  99.     }
  100.     public function setSouscategorie(?SouscategorieMetier $souscategorie): self
  101.     {
  102.         $this->souscategorie $souscategorie;
  103.         return $this;
  104.     }
  105.     public function getVersion(): ?int
  106.     {
  107.         return $this->version;
  108.     }
  109.     public function setVersion(?int $version): self
  110.     {
  111.         $this->version $version;
  112.         return $this;
  113.     }
  114.     public function getDateCreation(): ?\DateTimeInterface
  115.     {
  116.         return $this->date_creation;
  117.     }
  118.     public function setDateCreation(?\DateTimeInterface $date_creation): self
  119.     {
  120.         $this->date_creation $date_creation;
  121.         return $this;
  122.     }
  123.     public function getDateUpdate(): ?\DateTimeInterface
  124.     {
  125.         return $this->date_update;
  126.     }
  127.     public function setDateUpdate(?\DateTimeInterface $date_update): self
  128.     {
  129.         $this->date_update $date_update;
  130.         return $this;
  131.     }
  132.     /**
  133.      * @return Collection|FicheControlePreserie[]
  134.      */
  135.     public function getFicheControlePreseries(): Collection
  136.     {
  137.         return $this->ficheControlePreseries;
  138.     }
  139.     public function addFicheControlePreseries(FicheControlePreserie $ficheControlePreseries): self
  140.     {
  141.         if (!$this->ficheControlePreseries->contains($ficheControlePreseries)) {
  142.             $this->ficheControlePreseries[] = $ficheControlePreseries;
  143.             $ficheControlePreseries->setFichepreserie($this);
  144.         }
  145.         return $this;
  146.     }
  147.     public function removeFicheControlePreseries(FicheControlePreserie $ficheControlePreseries): self
  148.     {
  149.         if ($this->ficheControlePreseries->removeElement($ficheControlePreseries)) {
  150.             // set the owning side to null (unless already changed)
  151.             if ($ficheControlePreseries->getFichepreserie() === $this) {
  152.                 $ficheControlePreseries->setFichepreserie(null);
  153.             }
  154.         }
  155.         return $this;
  156.     }
  157.     public function getAtelier(): ?Atelier
  158.     {
  159.         return $this->atelier;
  160.     }
  161.     public function setAtelier(?Atelier $atelier): self
  162.     {
  163.         $this->atelier $atelier;
  164.         return $this;
  165.     }
  166.     public function getCotraitance(): ?bool
  167.     {
  168.         return $this->cotraitance;
  169.     }
  170.     public function setCotraitance(?bool $cotraitance): self
  171.     {
  172.         $this->cotraitance $cotraitance;
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return Collection|FichePreserieOperation[]
  177.      */
  178.     public function getOperations(): Collection
  179.     {
  180.         return $this->operations;
  181.     }
  182.     public function addOperation(FichePreserieOperation $fichePreserieOperation): self
  183.     {
  184.         if (!$this->operations->contains($fichePreserieOperation)) {
  185.             $this->operations[] = $fichePreserieOperation;
  186.             $fichePreserieOperation->setFichepreserie($this);
  187.         }
  188.         return $this;
  189.     }
  190.     public function removeOperation(FichePreserieOperation $fichePreserieOperation): self
  191.     {
  192.         if ($this->operations->removeElement($fichePreserieOperation)) {
  193.             // set the owning side to null (unless already changed)
  194.             if ($fichePreserieOperation->getFichepreserie() === $this) {
  195.                 $fichePreserieOperation->setFichepreserie(null);
  196.             }
  197.         }
  198.         return $this;
  199.     }
  200.     /**
  201.      * @return Collection|FichePreserieCoupe[]
  202.      */
  203.     public function getFichePreserieCoupes(): Collection
  204.     {
  205.         return $this->fichePreserieCoupes;
  206.     }
  207.     public function addFichePreserieCoupe(FichePreserieCoupe $fichePreserieCoupe): self
  208.     {
  209.         if (!$this->fichePreserieCoupes->contains($fichePreserieCoupe)) {
  210.             $this->fichePreserieCoupes[] = $fichePreserieCoupe;
  211.             $fichePreserieCoupe->setPreserie($this);
  212.         }
  213.         return $this;
  214.     }
  215.     public function removeFichePreserieCoupe(FichePreserieCoupe $fichePreserieCoupe): self
  216.     {
  217.         if ($this->fichePreserieCoupes->removeElement($fichePreserieCoupe)) {
  218.             // set the owning side to null (unless already changed)
  219.             if ($fichePreserieCoupe->getPreserie() === $this) {
  220.                 $fichePreserieCoupe->setPreserie(null);
  221.             }
  222.         }
  223.         return $this;
  224.     }
  225.     public function __toString(): string
  226.     {
  227.         return (string) $this->reference;
  228.     }
  229.     /**
  230.      * @return Collection|FicheQualite[]
  231.      */
  232.     public function getFicheQualites(): Collection
  233.     {
  234.         return $this->ficheQualites;
  235.     }
  236.     public function addFicheQualite(FicheQualite $ficheQualite): self
  237.     {
  238.         if (!$this->ficheQualites->contains($ficheQualite)) {
  239.             $this->ficheQualites[] = $ficheQualite;
  240.             $ficheQualite->setFichepreserie($this);
  241.         }
  242.         return $this;
  243.     }
  244.     public function removeFicheQualite(FicheQualite $ficheQualite): self
  245.     {
  246.         if ($this->ficheQualites->removeElement($ficheQualite)) {
  247.             // set the owning side to null (unless already changed)
  248.             if ($ficheQualite->getFichepreserie() === $this) {
  249.                 $ficheQualite->setFichepreserie(null);
  250.             }
  251.         }
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return Collection|FicheQualiteAtelierAuditeur[]
  256.      */
  257.     public function getFicheQualiteAtelierAuditeurs(): Collection
  258.     {
  259.         return $this->ficheQualiteAtelierAuditeurs;
  260.     }
  261.     public function addFicheQualiteAtelierAuditeur(FicheQualiteAtelierAuditeur $ficheQualiteAtelierAuditeur): self
  262.     {
  263.         if (!$this->ficheQualiteAtelierAuditeurs->contains($ficheQualiteAtelierAuditeur)) {
  264.             $this->ficheQualiteAtelierAuditeurs[] = $ficheQualiteAtelierAuditeur;
  265.             $ficheQualiteAtelierAuditeur->setFichepreserie($this);
  266.         }
  267.         return $this;
  268.     }
  269.     public function removeFicheQualiteAtelierAuditeur(FicheQualiteAtelierAuditeur $ficheQualiteAtelierAuditeur): self
  270.     {
  271.         if ($this->ficheQualiteAtelierAuditeurs->removeElement($ficheQualiteAtelierAuditeur)) {
  272.             // set the owning side to null (unless already changed)
  273.             if ($ficheQualiteAtelierAuditeur->getFichepreserie() === $this) {
  274.                 $ficheQualiteAtelierAuditeur->setFichepreserie(null);
  275.             }
  276.         }
  277.         return $this;
  278.     }
  279.     /**
  280.      * @return Collection|FicheQualiteSynthese[]
  281.      */
  282.     public function getFicheQualiteSyntheses(): Collection
  283.     {
  284.         return $this->ficheQualiteSyntheses;
  285.     }
  286.     public function addFicheQualiteSynthesis(FicheQualiteSynthese $ficheQualiteSynthesis): self
  287.     {
  288.         if (!$this->ficheQualiteSyntheses->contains($ficheQualiteSynthesis)) {
  289.             $this->ficheQualiteSyntheses[] = $ficheQualiteSynthesis;
  290.             $ficheQualiteSynthesis->setFichePreserie($this);
  291.         }
  292.         return $this;
  293.     }
  294.     public function removeFicheQualiteSynthesis(FicheQualiteSynthese $ficheQualiteSynthesis): self
  295.     {
  296.         if ($this->ficheQualiteSyntheses->removeElement($ficheQualiteSynthesis)) {
  297.             // set the owning side to null (unless already changed)
  298.             if ($ficheQualiteSynthesis->getFichePreserie() === $this) {
  299.                 $ficheQualiteSynthesis->setFichePreserie(null);
  300.             }
  301.         }
  302.         return $this;
  303.     }
  304.     /**
  305.      * @return Collection|FicheQualiteAtelier[]
  306.      */
  307.     public function getFicheQualiteAteliers(): Collection
  308.     {
  309.         return $this->ficheQualiteAteliers;
  310.     }
  311.     public function addFicheQualiteAtelier(FicheQualiteAtelier $ficheQualiteAtelier): self
  312.     {
  313.         if (!$this->ficheQualiteAteliers->contains($ficheQualiteAtelier)) {
  314.             $this->ficheQualiteAteliers[] = $ficheQualiteAtelier;
  315.             $ficheQualiteAtelier->setFichepreserie($this);
  316.         }
  317.         return $this;
  318.     }
  319.     public function removeFicheQualiteAtelier(FicheQualiteAtelier $ficheQualiteAtelier): self
  320.     {
  321.         if ($this->ficheQualiteAteliers->removeElement($ficheQualiteAtelier)) {
  322.             // set the owning side to null (unless already changed)
  323.             if ($ficheQualiteAtelier->getFichepreserie() === $this) {
  324.                 $ficheQualiteAtelier->setFichepreserie(null);
  325.             }
  326.         }
  327.         return $this;
  328.     }
  329.     /**
  330.      * @return Collection|FicheQualiteCent[]
  331.      */
  332.     public function getFicheQualiteCents(): Collection
  333.     {
  334.         return $this->ficheQualiteCents;
  335.     }
  336.     public function addFicheQualiteCent(FicheQualiteCent $ficheQualiteCent): self
  337.     {
  338.         if (!$this->ficheQualiteCents->contains($ficheQualiteCent)) {
  339.             $this->ficheQualiteCents[] = $ficheQualiteCent;
  340.             $ficheQualiteCent->setFichepreserie($this);
  341.         }
  342.         return $this;
  343.     }
  344.     public function removeFicheQualiteCent(FicheQualiteCent $ficheQualiteCent): self
  345.     {
  346.         if ($this->ficheQualiteCents->removeElement($ficheQualiteCent)) {
  347.             // set the owning side to null (unless already changed)
  348.             if ($ficheQualiteCent->getFichepreserie() === $this) {
  349.                 $ficheQualiteCent->setFichepreserie(null);
  350.             }
  351.         }
  352.         return $this;
  353.     }
  354. }