<?php
namespace App\Entity;
use App\Repository\EtatOpeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EtatOpeRepository::class)
*/
class EtatOpe
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $libelle;
/**
* @ORM\OneToMany(targetEntity=Operations::class, mappedBy="etatOpe")
*/
private $operations;
public function __construct()
{
$this->operations = new ArrayCollection();
}
public function __toString()
{
return (string) $this->getLibelle();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return Collection<int, Operations>
*/
public function getOperations(): Collection
{
return $this->operations;
}
public function addOperation(Operations $operation): self
{
if (!$this->operations->contains($operation)) {
$this->operations[] = $operation;
$operation->setEtatOpe($this);
}
return $this;
}
public function removeOperation(Operations $operation): self
{
if ($this->operations->removeElement($operation)) {
// set the owning side to null (unless already changed)
if ($operation->getEtatOpe() === $this) {
$operation->setEtatOpe(null);
}
}
return $this;
}
}