<?phpnamespace App\Entity;use App\Repository\TableauMesureEnCoursRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: TableauMesureEnCoursRepository::class)]class TableauMesureEnCours{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\ManyToOne(targetEntity: TableauMesureLibelle::class, inversedBy: 'tableauMesureEnCours')] private $mesure; #[ORM\Column(type: 'float', nullable: true)] private $tolerance; #[ORM\ManyToOne(targetEntity: TableauMesure::class, inversedBy: 'mesures_en_cours')] private $tableauMesure; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $numero; #[ORM\OneToMany(targetEntity: TableauMesureEnCoursValeur::class, mappedBy: 'tableauMesureEnCours', cascade: ['persist', 'remove'])] private $valeurs; public function __clone(){ if ($this->id) { $this->id = null; $valeursCollection = new ArrayCollection(); foreach ($this->valeurs as $valeur) { $valeurClone = clone $valeur; $valeurClone->setTableauMesureEnCours($this); $valeursCollection->add($valeurClone); } $this->valeurs = $valeursCollection; return $this; } } public function __construct() { $this->valeurs = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getMesure(): ?TableauMesureLibelle { return $this->mesure; } public function setMesure(?TableauMesureLibelle $mesure): self { $this->mesure = $mesure; return $this; } public function getTolerance(): ?float { return $this->tolerance; } public function setTolerance(?float $tolerance): self { $this->tolerance = $tolerance; return $this; } public function getTableauMesure(): ?TableauMesure { return $this->tableauMesure; } public function setTableauMesure(?TableauMesure $tableauMesure): self { $this->tableauMesure = $tableauMesure; return $this; } public function getNumero(): ?string { return $this->numero; } public function setNumero(?string $numero): self { $this->numero = $numero; return $this; } /** * @return Collection|TableauMesureEnCoursValeur[] */ public function getValeurs(): Collection { return $this->valeurs; } public function addValeur(TableauMesureEnCoursValeur $valeur): self { if (!$this->valeurs->contains($valeur)) { $this->valeurs[] = $valeur; $valeur->setTableauMesureEnCours($this); } return $this; } public function removeValeur(TableauMesureEnCoursValeur $valeur): self { if ($this->valeurs->removeElement($valeur)) { // set the owning side to null (unless already changed) if ($valeur->getTableauMesureEnCours() === $this) { $valeur->setTableauMesureEnCours(null); } } return $this; }}