src/Entity/EstadoCheck.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\EstadoCheckRepository")
  8. * @ORM\Table(name="estado_check", schema="perseo")
  9. */
  10. class EstadoCheck extends EstadoAbstract
  11. {
  12. /**
  13. * @ORM\OneToMany(targetEntity="App\Entity\AccionCheck", mappedBy="estado")
  14. */
  15. private $accionesCheck;
  16. /**
  17. * @ORM\OneToMany(targetEntity="App\Entity\Reloj", mappedBy="check")
  18. */
  19. private $relojes;
  20. public function __construct()
  21. {
  22. $this->accionesCheck = new ArrayCollection();
  23. $this->relojes = new ArrayCollection();
  24. }
  25. /**
  26. * @return Collection<int, AccionCheck>
  27. */
  28. public function getAccionesCheck(): Collection
  29. {
  30. return $this->accionesCheck;
  31. }
  32. public function addAccionesCheck(AccionCheck $accionesCheck): self
  33. {
  34. if (!$this->accionesCheck->contains($accionesCheck)) {
  35. $this->accionesCheck->add($accionesCheck);
  36. $accionesCheck->setEstado($this);
  37. }
  38. return $this;
  39. }
  40. public function removeAccionesCheck(AccionCheck $accionesCheck): self
  41. {
  42. if ($this->accionesCheck->removeElement($accionesCheck)) {
  43. // set the owning side to null (unless already changed)
  44. if ($accionesCheck->getEstado() === $this) {
  45. $accionesCheck->setEstado(null);
  46. }
  47. }
  48. return $this;
  49. }
  50. /**
  51. * @return Collection<int, Reloj>
  52. */
  53. public function getRelojes(): Collection
  54. {
  55. return $this->relojes;
  56. }
  57. public function addReloje(Reloj $reloje): self
  58. {
  59. if (!$this->relojes->contains($reloje)) {
  60. $this->relojes->add($reloje);
  61. $reloje->setCheck($this);
  62. }
  63. return $this;
  64. }
  65. public function removeReloje(Reloj $reloje): self
  66. {
  67. if ($this->relojes->removeElement($reloje)) {
  68. // set the owning side to null (unless already changed)
  69. if ($reloje->getCheck() === $this) {
  70. $reloje->setCheck(null);
  71. }
  72. }
  73. return $this;
  74. }
  75. }