<?phpnamespace App\Entity;use App\Repository\TableauMesureTermineRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: TableauMesureTermineRepository::class)]class TableauMesureTermine{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\ManyToOne(targetEntity: TableauMesureLibelle::class, inversedBy: 'tableauMesureTermine')] private $mesure; #[ORM\Column(type: 'float', nullable: true)] private $tolerance; #[ORM\ManyToOne(targetEntity: TableauMesure::class, inversedBy: 'mesures_termine')] private $tableauMesure; #[ORM\OneToMany(targetEntity: TableauMesureTermineValeur::class, mappedBy: 'tableauMesureTermine', cascade: ['persist', 'remove'])] private $valeurs; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $numero; public function __clone(){ if ($this->id) { $this->id = null; $valeursCollection = new ArrayCollection(); foreach ($this->valeurs as $valeur) { $valeurClone = clone $valeur; $valeurClone->setTableauMesureTermine($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; } /** * @return Collection|TableauMesureTermineValeur[] */ public function getValeurs(): Collection { return $this->valeurs; } public function addValeur(TableauMesureTermineValeur $valeur): self { if (!$this->valeurs->contains($valeur)) { $this->valeurs[] = $valeur; $valeur->setTableauMesureTermine($this); } return $this; } public function removeValeur(TableauMesureTermineValeur $valeur): self { if ($this->valeurs->removeElement($valeur)) { // set the owning side to null (unless already changed) if ($valeur->getTableauMesureTermine() === $this) { $valeur->setTableauMesureTermine(null); } } return $this; } public function getNumero(): ?string { return $this->numero; } public function setNumero(?string $numero): self { $this->numero = $numero; return $this; }}