src/Entity/Operation.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OperationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOperationRepository::class)]
  8. class Operation 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 $name;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $name_en;
  18.     #[ORM\OneToMany(targetEntityFichePreserieOperation::class, mappedBy'operation')]
  19.     private $fichePreserieOperations;
  20.     #[ORM\OneToMany(targetEntityFicheControlePreserieOperation::class, mappedBy'operation')]
  21.     private $ficheControlePreserieOperations;
  22.     #[ORM\OneToMany(targetEntityFicheControleEnCoursDefaut::class, mappedBy'operation')]
  23.     private $ficheControleEnCoursDefauts;
  24.     public function __construct()
  25.     {
  26.         $this->fichePreserieOperations = new ArrayCollection();
  27.         $this->ficheControlePreserieOperations = new ArrayCollection();
  28.         $this->ficheControleEnCoursDefauts = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(?string $name): self
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     public function getNameEn(): ?string
  44.     {
  45.         return $this->name_en;
  46.     }
  47.     public function setNameEn(?string $name_en): self
  48.     {
  49.         $this->name_en $name_en;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection|FichePreserieOperation[]
  54.      */
  55.     public function getFichePreserieOperations(): Collection
  56.     {
  57.         return $this->fichePreserieOperations;
  58.     }
  59.     public function addFichePreserieOperation(FichePreserieOperation $fichePreserieOperation): self
  60.     {
  61.         if (!$this->fichePreserieOperations->contains($fichePreserieOperation)) {
  62.             $this->fichePreserieOperations[] = $fichePreserieOperation;
  63.             $fichePreserieOperation->setOperation($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeFichePreserieOperation(FichePreserieOperation $fichePreserieOperation): self
  68.     {
  69.         if ($this->fichePreserieOperations->removeElement($fichePreserieOperation)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($fichePreserieOperation->getOperation() === $this) {
  72.                 $fichePreserieOperation->setOperation(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     public function __toString(): string{
  78.         return (string) $this->name;
  79.     }
  80.     /**
  81.      * @return Collection|FicheControlePreserieOperation[]
  82.      */
  83.     public function getFicheControlePreserieOperations(): Collection
  84.     {
  85.         return $this->ficheControlePreserieOperations;
  86.     }
  87.     public function addFicheControlePreserieOperation(FicheControlePreserieOperation $ficheControlePreserieOperation): self
  88.     {
  89.         if (!$this->ficheControlePreserieOperations->contains($ficheControlePreserieOperation)) {
  90.             $this->ficheControlePreserieOperations[] = $ficheControlePreserieOperation;
  91.             $ficheControlePreserieOperation->setOperation($this);
  92.         }
  93.         return $this;
  94.     }
  95.     public function removeFicheControlePreserieOperation(FicheControlePreserieOperation $ficheControlePreserieOperation): self
  96.     {
  97.         if ($this->ficheControlePreserieOperations->removeElement($ficheControlePreserieOperation)) {
  98.             // set the owning side to null (unless already changed)
  99.             if ($ficheControlePreserieOperation->getOperation() === $this) {
  100.                 $ficheControlePreserieOperation->setOperation(null);
  101.             }
  102.         }
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return Collection<int, FicheControleEnCoursDefaut>
  107.      */
  108.     public function getFicheControleEnCoursDefauts(): Collection
  109.     {
  110.         return $this->ficheControleEnCoursDefauts;
  111.     }
  112.     public function addFicheControleEnCoursDefaut(FicheControleEnCoursDefaut $ficheControleEnCoursDefaut): self
  113.     {
  114.         if (!$this->ficheControleEnCoursDefauts->contains($ficheControleEnCoursDefaut)) {
  115.             $this->ficheControleEnCoursDefauts[] = $ficheControleEnCoursDefaut;
  116.             $ficheControleEnCoursDefaut->setOperation($this);
  117.         }
  118.         return $this;
  119.     }
  120.     public function removeFicheControleEnCoursDefaut(FicheControleEnCoursDefaut $ficheControleEnCoursDefaut): self
  121.     {
  122.         if ($this->ficheControleEnCoursDefauts->removeElement($ficheControleEnCoursDefaut)) {
  123.             // set the owning side to null (unless already changed)
  124.             if ($ficheControleEnCoursDefaut->getOperation() === $this) {
  125.                 $ficheControleEnCoursDefaut->setOperation(null);
  126.             }
  127.         }
  128.         return $this;
  129.     }
  130. }