<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\EstadoRelojRepository")
* @ORM\Table(name="estado_reloj", schema="perseo")
*/
class EstadoReloj extends EstadoAbstract
{
/**
* @ORM\OneToMany(targetEntity="App\Entity\Reloj", mappedBy="estado")
*/
protected $relojes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\AccionEstado", mappedBy="estado")
*/
protected $accionesEstado;
public function __construct()
{
$this->relojes = new ArrayCollection();
$this->accionesEstado = new ArrayCollection();
}
/**
* @return Collection|Reloj[]
*/
public function getRelojes(): Collection
{
return $this->relojes;
}
public function addReloje(Reloj $reloje): self
{
if (!$this->relojes->contains($reloje)) {
$this->relojes[] = $reloje;
$reloje->setEstado($this);
}
return $this;
}
public function removeReloje(Reloj $reloje): self
{
if ($this->relojes->removeElement($reloje)) {
// set the owning side to null (unless already changed)
if ($reloje->getEstado() === $this) {
$reloje->setEstado(null);
}
}
return $this;
}
/**
* @return Collection<int, AccionEstado>
*/
public function getAccionesEstado(): Collection
{
return $this->accionesEstado;
}
public function addAccionesEstado(AccionEstado $accionesEstado): self
{
if (!$this->accionesEstado->contains($accionesEstado)) {
$this->accionesEstado->add($accionesEstado);
$accionesEstado->setEstado($this);
}
return $this;
}
public function removeAccionesEstado(AccionEstado $accionesEstado): self
{
if ($this->accionesEstado->removeElement($accionesEstado)) {
// set the owning side to null (unless already changed)
if ($accionesEstado->getEstado() === $this) {
$accionesEstado->setEstado(null);
}
}
return $this;
}
}