src/Entity/EstadoOperacion.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\EstadoOperacionRepository")
  8. * @ORM\Table(name="estado_operacion", schema="perseo")
  9. */
  10. class EstadoOperacion extends EstadoAbstract
  11. {
  12. /**
  13. * @ORM\OneToMany(targetEntity="App\Entity\Operacion", mappedBy="estado")
  14. */
  15. private $operaciones;
  16. public function __construct()
  17. {
  18. $this->operaciones = new ArrayCollection();
  19. }
  20. /**
  21. * @return Collection|Operacion[]
  22. */
  23. public function getOperaciones(): Collection
  24. {
  25. return $this->operaciones;
  26. }
  27. public function addOperacione(Operacion $operacione): self
  28. {
  29. if (!$this->operaciones->contains($operacione)) {
  30. $this->operaciones[] = $operacione;
  31. $operacione->setEstado($this);
  32. }
  33. return $this;
  34. }
  35. public function removeOperacione(Operacion $operacione): self
  36. {
  37. if ($this->operaciones->removeElement($operacione)) {
  38. // set the owning side to null (unless already changed)
  39. if ($operacione->getEstado() === $this) {
  40. $operacione->setEstado(null);
  41. }
  42. }
  43. return $this;
  44. }
  45. }