src/Entity/TableauMesureEnCours.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TableauMesureEnCoursRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTableauMesureEnCoursRepository::class)]
  8. class TableauMesureEnCours
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityTableauMesureLibelle::class, inversedBy'tableauMesureEnCours')]
  15.     private $mesure;
  16.     #[ORM\Column(type'float'nullabletrue)]
  17.     private $tolerance;
  18.     #[ORM\ManyToOne(targetEntityTableauMesure::class, inversedBy'mesures_en_cours')]
  19.     private $tableauMesure;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private $numero;
  22.     #[ORM\OneToMany(targetEntityTableauMesureEnCoursValeur::class, mappedBy'tableauMesureEnCours'cascade: ['persist''remove'])]
  23.     private $valeurs;
  24.     public function __clone(){
  25.         if ($this->id) {
  26.             $this->id null;
  27.                                                                                     
  28.             $valeursCollection = new ArrayCollection();                   
  29.             foreach ($this->valeurs as $valeur) {                             
  30.                 $valeurClone = clone $valeur
  31.                 $valeurClone->setTableauMesureEnCours($this);                             
  32.                 $valeursCollection->add($valeurClone);                   
  33.             }                                                               
  34.             $this->valeurs $valeursCollection
  35.             return $this;
  36.         }
  37.     }
  38.     public function __construct()
  39.     {
  40.         $this->valeurs = new ArrayCollection();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getMesure(): ?TableauMesureLibelle
  47.     {
  48.         return $this->mesure;
  49.     }
  50.     public function setMesure(?TableauMesureLibelle $mesure): self
  51.     {
  52.         $this->mesure $mesure;
  53.         return $this;
  54.     }
  55.     public function getTolerance(): ?float
  56.     {
  57.         return $this->tolerance;
  58.     }
  59.     public function setTolerance(?float $tolerance): self
  60.     {
  61.         $this->tolerance $tolerance;
  62.         return $this;
  63.     }
  64.     public function getTableauMesure(): ?TableauMesure
  65.     {
  66.         return $this->tableauMesure;
  67.     }
  68.     public function setTableauMesure(?TableauMesure $tableauMesure): self
  69.     {
  70.         $this->tableauMesure $tableauMesure;
  71.         return $this;
  72.     }
  73.     public function getNumero(): ?string
  74.     {
  75.         return $this->numero;
  76.     }
  77.     public function setNumero(?string $numero): self
  78.     {
  79.         $this->numero $numero;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection|TableauMesureEnCoursValeur[]
  84.      */
  85.     public function getValeurs(): Collection
  86.     {
  87.         return $this->valeurs;
  88.     }
  89.     public function addValeur(TableauMesureEnCoursValeur $valeur): self
  90.     {
  91.         if (!$this->valeurs->contains($valeur)) {
  92.             $this->valeurs[] = $valeur;
  93.             $valeur->setTableauMesureEnCours($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeValeur(TableauMesureEnCoursValeur $valeur): self
  98.     {
  99.         if ($this->valeurs->removeElement($valeur)) {
  100.             // set the owning side to null (unless already changed)
  101.             if ($valeur->getTableauMesureEnCours() === $this) {
  102.                 $valeur->setTableauMesureEnCours(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107. }