src/Entity/AccionEstado.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\TipoAccionEnum;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\AccionEstadoRepository")
  8.  * @ORM\Table(name="accion_estado", schema="perseo")
  9.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  10.  */
  11. class AccionEstado extends AccionAbstract
  12. {
  13.     /**
  14.      * @ORM\Column(type="float", nullable=true, precision=2)
  15.      */
  16.     private $precio;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\EstadoReloj", inversedBy="accionesEstado")
  19.      * @ORM\JoinColumn(name="estado_reloj_id", referencedColumnName="id")
  20.      */
  21.     private $estado;
  22.     public function __toString(): string
  23.     {
  24.         return $this->getEstado()?->getNombre() ?? '---';
  25.     }
  26.     public function getPrecio(): ?float
  27.     {
  28.         return $this->precio;
  29.     }
  30.     public function setPrecio(?float $precio): self
  31.     {
  32.         $this->precio $precio;
  33.         return $this;
  34.     }
  35.     public function getEstado(): ?EstadoReloj
  36.     {
  37.         return $this->estado;
  38.     }
  39.     public function setEstado(?EstadoReloj $estado): self
  40.     {
  41.         $this->estado $estado;
  42.         return $this;
  43.     }
  44. }