<?phpnamespace App\Entity;use App\Repository\OperationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OperationRepository::class)]class Operation implements \Stringable{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $name; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $name_en; #[ORM\OneToMany(targetEntity: FichePreserieOperation::class, mappedBy: 'operation')] private $fichePreserieOperations; #[ORM\OneToMany(targetEntity: FicheControlePreserieOperation::class, mappedBy: 'operation')] private $ficheControlePreserieOperations; #[ORM\OneToMany(targetEntity: FicheControleEnCoursDefaut::class, mappedBy: 'operation')] private $ficheControleEnCoursDefauts; public function __construct() { $this->fichePreserieOperations = new ArrayCollection(); $this->ficheControlePreserieOperations = new ArrayCollection(); $this->ficheControleEnCoursDefauts = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getNameEn(): ?string { return $this->name_en; } public function setNameEn(?string $name_en): self { $this->name_en = $name_en; return $this; } /** * @return Collection|FichePreserieOperation[] */ public function getFichePreserieOperations(): Collection { return $this->fichePreserieOperations; } public function addFichePreserieOperation(FichePreserieOperation $fichePreserieOperation): self { if (!$this->fichePreserieOperations->contains($fichePreserieOperation)) { $this->fichePreserieOperations[] = $fichePreserieOperation; $fichePreserieOperation->setOperation($this); } return $this; } public function removeFichePreserieOperation(FichePreserieOperation $fichePreserieOperation): self { if ($this->fichePreserieOperations->removeElement($fichePreserieOperation)) { // set the owning side to null (unless already changed) if ($fichePreserieOperation->getOperation() === $this) { $fichePreserieOperation->setOperation(null); } } return $this; } public function __toString(): string{ return (string) $this->name; } /** * @return Collection|FicheControlePreserieOperation[] */ public function getFicheControlePreserieOperations(): Collection { return $this->ficheControlePreserieOperations; } public function addFicheControlePreserieOperation(FicheControlePreserieOperation $ficheControlePreserieOperation): self { if (!$this->ficheControlePreserieOperations->contains($ficheControlePreserieOperation)) { $this->ficheControlePreserieOperations[] = $ficheControlePreserieOperation; $ficheControlePreserieOperation->setOperation($this); } return $this; } public function removeFicheControlePreserieOperation(FicheControlePreserieOperation $ficheControlePreserieOperation): self { if ($this->ficheControlePreserieOperations->removeElement($ficheControlePreserieOperation)) { // set the owning side to null (unless already changed) if ($ficheControlePreserieOperation->getOperation() === $this) { $ficheControlePreserieOperation->setOperation(null); } } return $this; } /** * @return Collection<int, FicheControleEnCoursDefaut> */ public function getFicheControleEnCoursDefauts(): Collection { return $this->ficheControleEnCoursDefauts; } public function addFicheControleEnCoursDefaut(FicheControleEnCoursDefaut $ficheControleEnCoursDefaut): self { if (!$this->ficheControleEnCoursDefauts->contains($ficheControleEnCoursDefaut)) { $this->ficheControleEnCoursDefauts[] = $ficheControleEnCoursDefaut; $ficheControleEnCoursDefaut->setOperation($this); } return $this; } public function removeFicheControleEnCoursDefaut(FicheControleEnCoursDefaut $ficheControleEnCoursDefaut): self { if ($this->ficheControleEnCoursDefauts->removeElement($ficheControleEnCoursDefaut)) { // set the owning side to null (unless already changed) if ($ficheControleEnCoursDefaut->getOperation() === $this) { $ficheControleEnCoursDefaut->setOperation(null); } } return $this; }}