src/Entity/HistorialDevolucion.php line 16
- <?php
- namespace App\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\DBAL\Types\Types;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * HistorialDevolucion
- *
- * @ORM\Table("historial_devolucion")
- * @ORM\Entity()
- */
- class HistorialDevolucion
- {
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="fecha", type="datetime", nullable=false)
- */
- private $fecha;
- /**
- * @var float
- *
- * @ORM\Column(name="devuelto", type="float")
- */
- private $devuelto;
- /**
- * @ORM\ManyToOne(targetEntity="User", inversedBy="historialDevoluciones")
- * @ORM\JoinColumn(name="usuario", referencedColumnName="id")
- */
- private $usuario;
- /**
- * @ORM\ManyToOne(targetEntity="Transaccion", inversedBy="historialDevoluciones"))
- * @ORM\JoinColumn(name="transaccion", referencedColumnName="id", nullable=true)
- */
- private $transaccion;
- /**
- * @ORM\ManyToOne(targetEntity="PagoTPV", inversedBy="historialDevoluciones"))
- * @ORM\JoinColumn(name="pago_tpv", referencedColumnName="id", nullable=true)
- */
- private $pagoTpv;
- public function __toString()
- {
- return (string) $this->getFecha()?->format('Y-m-d') . ' - ' . (string) $this->getId() . ' - ' . (string) $this->getDevuelto() . '€';
- }
- public function __construct()
- {
- $this->fecha = new \DateTime("now");
- }
- public function getId()
- {
- return $this->id;
- }
- public function setFecha(\DateTime $fecha)
- {
- $this->fecha = $fecha;
- return $this;
- }
- public function getFecha()
- {
- return $this->fecha;
- }
- public function getDevuelto()
- {
- return $this->devuelto;
- }
- public function setDevuelto($devuelto)
- {
- $this->devuelto = $devuelto;
- return $this;
- }
- public function setUsuario($usuario)
- {
- $this->usuario = $usuario;
- return $this;
- }
- public function getUsuario()
- {
- return $this->usuario;
- }
- public function setTransaccion($transaccion)
- {
- $this->transaccion = $transaccion;
- return $this;
- }
- public function getTransaccion()
- {
- return $this->transaccion;
- }
- public function setPagoTpv($pagoTpv)
- {
- $this->pagoTpv = $pagoTpv;
- return $this;
- }
- public function getPagoTpv()
- {
- return $this->pagoTpv;
- }
- }