src/Entity/AccionServicio.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\AccionServicioRepository")
  8.  * @ORM\Table(name="accion_servicio", schema="perseo")
  9.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  10.  */
  11. class AccionServicio extends AccionAbstract
  12. {
  13.     /**
  14.      * @ORM\Column(type="float", nullable=true, precision=2)
  15.      */
  16.     private $coste;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\TipoCargoServicio", inversedBy="accionesServicio")
  19.      * @ORM\JoinColumn(name="tipo_cargo_id", referencedColumnName="id")
  20.      */
  21.     private $tipo;
  22.     public function __toString(): string
  23.     {
  24.         return $this->getTipo()?->getNombre() ?? '---';
  25.     }
  26.     public function getCoste(): ?float
  27.     {
  28.         return $this->coste;
  29.     }
  30.     public function setCoste(?float $coste): self
  31.     {
  32.         $this->coste $coste;
  33.         return $this;
  34.     }
  35.     public function getTipo(): ?TipoCargoServicio
  36.     {
  37.         return $this->tipo;
  38.     }
  39.     public function setTipo(?TipoCargoServicio $tipo): self
  40.     {
  41.         $this->tipo $tipo;
  42.         return $this;
  43.     }
  44. }