src/Entity/AccionUbicacion.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\AccionUbicacionRepository")
  8.  * @ORM\Table(name="accion_ubicacion", schema="perseo")
  9.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  10.  */
  11. class AccionUbicacion extends AccionAbstract
  12. {
  13.     /**
  14.      * @ORM\ManyToOne(targetEntity="App\Entity\UbicacionAbstract", inversedBy="accionesUbicacionActual")
  15.      * @ORM\JoinColumn(name="ubicacion_actual_id", referencedColumnName="id")
  16.      */
  17.     private $ubicacionActual;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity="App\Entity\UbicacionAbstract", inversedBy="accionesUbicacionAnterior")
  20.      * @ORM\JoinColumn(name="ubicacion_anterior_id", referencedColumnName="id")
  21.      */
  22.     private $ubicacionAnterior;
  23.     public function __toString(): string
  24.     {
  25.         return $this->getUbicacionActual()?->getNombre() ?? '---';
  26.     }
  27.     public function getUbicacionActual(): ?UbicacionAbstract
  28.     {
  29.         return $this->ubicacionActual;
  30.     }
  31.     public function setUbicacionActual(?UbicacionAbstract $ubicacionActual): self
  32.     {
  33.         $this->ubicacionActual $ubicacionActual;
  34.         return $this;
  35.     }
  36.     public function getUbicacionAnterior(): ?UbicacionAbstract
  37.     {
  38.         return $this->ubicacionAnterior;
  39.     }
  40.     public function setUbicacionAnterior(?UbicacionAbstract $ubicacionAnterior): self
  41.     {
  42.         $this->ubicacionAnterior $ubicacionAnterior;
  43.         return $this;
  44.     }
  45. }