src/Entity/EtatOpe.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EtatOpeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EtatOpeRepository::class)
  9.  */
  10. class EtatOpe
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $libelle;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Operations::class, mappedBy="etatOpe")
  24.      */
  25.     private $operations;
  26.     public function __construct()
  27.     {
  28.         $this->operations = new ArrayCollection();
  29.     }
  30.         
  31.     public function __toString()
  32.     {
  33.         return (string) $this->getLibelle();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getLibelle(): ?string
  40.     {
  41.         return $this->libelle;
  42.     }
  43.     public function setLibelle(string $libelle): self
  44.     {
  45.         $this->libelle $libelle;
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Collection<int, Operations>
  50.      */
  51.     public function getOperations(): Collection
  52.     {
  53.         return $this->operations;
  54.     }
  55.     public function addOperation(Operations $operation): self
  56.     {
  57.         if (!$this->operations->contains($operation)) {
  58.             $this->operations[] = $operation;
  59.             $operation->setEtatOpe($this);
  60.         }
  61.         return $this;
  62.     }
  63.     public function removeOperation(Operations $operation): self
  64.     {
  65.         if ($this->operations->removeElement($operation)) {
  66.             // set the owning side to null (unless already changed)
  67.             if ($operation->getEtatOpe() === $this) {
  68.                 $operation->setEtatOpe(null);
  69.             }
  70.         }
  71.         return $this;
  72.     }
  73. }