src/Entity/HistorialDevolucion.php line 16

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * HistorialDevolucion
  9.  *
  10.  * @ORM\Table("historial_devolucion")
  11.  * @ORM\Entity()
  12.  */
  13. class HistorialDevolucion
  14. {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var \DateTime
  25.      *
  26.      * @ORM\Column(name="fecha", type="datetime", nullable=false)
  27.      */
  28.     private $fecha;
  29.     /**
  30.      * @var float
  31.      *
  32.      * @ORM\Column(name="devuelto", type="float")
  33.      */
  34.     private $devuelto;
  35.     /**
  36.     * @ORM\ManyToOne(targetEntity="User", inversedBy="historialDevoluciones")
  37.     * @ORM\JoinColumn(name="usuario", referencedColumnName="id")
  38.     */
  39.     private $usuario;
  40.     /**
  41.     * @ORM\ManyToOne(targetEntity="Transaccion", inversedBy="historialDevoluciones"))
  42.     * @ORM\JoinColumn(name="transaccion", referencedColumnName="id", nullable=true)
  43.     */
  44.     private $transaccion;
  45.     /**
  46.     * @ORM\ManyToOne(targetEntity="PagoTPV", inversedBy="historialDevoluciones"))
  47.     * @ORM\JoinColumn(name="pago_tpv", referencedColumnName="id", nullable=true)
  48.     */
  49.     private $pagoTpv;
  50.     public function __toString()
  51.     {
  52.         return (string) $this->getFecha()?->format('Y-m-d') . ' - ' . (string) $this->getId() . ' - ' . (string) $this->getDevuelto() . '€';
  53.     }
  54.     public function __construct()
  55.     {
  56.         $this->fecha = new \DateTime("now");
  57.     }
  58.     public function getId()
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function setFecha(\DateTime $fecha)
  63.     {
  64.         $this->fecha $fecha;
  65.         return $this;
  66.     }
  67.     public function getFecha()
  68.     {
  69.         return $this->fecha;
  70.     }
  71.     public function getDevuelto()
  72.     {
  73.         return $this->devuelto;
  74.     }
  75.     public function setDevuelto($devuelto)
  76.     {
  77.         $this->devuelto $devuelto;
  78.         return $this;
  79.     }
  80.     public function setUsuario($usuario)
  81.     {
  82.         $this->usuario $usuario;
  83.         return $this;
  84.     }
  85.     public function getUsuario()
  86.     {
  87.         return $this->usuario;
  88.     }
  89.     public function setTransaccion($transaccion)
  90.     {
  91.         $this->transaccion $transaccion;
  92.         return $this;
  93.     }
  94.     public function getTransaccion()
  95.     {
  96.         return $this->transaccion;
  97.     }
  98.     public function setPagoTpv($pagoTpv)
  99.     {
  100.         $this->pagoTpv $pagoTpv;
  101.         return $this;
  102.     }
  103.     public function getPagoTpv()
  104.     {
  105.         return $this->pagoTpv;
  106.     }
  107. }