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