<?php
namespace App\Entity;
use App\Enum\EstadoOperacionEnum;
use App\Enum\EstadoRelojEnum;
use App\Enum\TipoAccionEnum;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\AccionEstadoRepository") * @ORM\Table(name="accion_estado") * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true) */class AccionEstado extends AccionAbstract
{
/**
* @ORM\Column(type="float", nullable=true, precision=2) */ private $precio;
/**
* @ORM\Column(type="float", nullable=true, precision=2) */ private $coste;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\EstadoReloj", inversedBy="accionesEstado") * @ORM\JoinColumn(name="estado_reloj_id", referencedColumnName="id") */ private $estado;
public function __toString(): string
{
return $this->getEstado()?->getNombre() ?? '---';
} public function getPrecio(): ?float
{
return $this->precio;
} public function setPrecio(?float $precio): self
{
$this->precio = $precio;
return $this;
} public function getEstado(): ?EstadoReloj
{
return $this->estado;
} public function setEstado(?EstadoReloj $estado): self
{
$this->estado = $estado;
return $this;
} /**
* Comprueba si el estado es Compra * @return bool */ public function isPurchase(): bool
{
return $this->getEstado()->getKey() === EstadoRelojEnum::ESTADO_COMPRA;
} /**
* Comprueba si el estado es Gestión * @return bool */ public function isManagement(): bool
{
return $this->getEstado()->getKey() === EstadoRelojEnum::ESTADO_GESTION;
} /**
* Comprueba si el estado es Enviado * @return bool */ public function isSent(): bool
{
return $this->getEstado()->getKey() === EstadoRelojEnum::ESTADO_ENVIADO;
} /**
* Comprueba si el estado es Recepción * @return bool */ public function isReception(): bool
{
return $this->getEstado()->getKey() === EstadoRelojEnum::ESTADO_RECEPCION;
} /**
* Comprueba si el estado es En Tramitación * @return bool */ public function isInProcess(): bool
{
return $this->getEstado()->getKey() === EstadoRelojEnum::ESTADO_EN_TRAMITACION;
} public function isImport(): bool
{
return $this->getEstado()->getKey() === EstadoRelojEnum::ESTADO_IMPORTACION;
} public function getCoste(): ?float
{
return $this->coste;
} public function setCoste(?float $coste): static
{ $this->coste = $coste;
return $this;
}}