src/Entity/FattureInCloud/DocumentoPagamento.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\FattureInCloud;
  3. use App\API\FattureInCloud\Response\DocumentoPagamentoResponse;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity()
  7.  */
  8. class DocumentoPagamento
  9. {
  10.     /**
  11.      * Not mapped to API, needed by Doctrine
  12.      * @var integer;
  13.      *
  14.      * @ORM\Id()
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\GeneratedValue(strategy="AUTO")
  17.      */
  18.     private $id;
  19.     /**
  20.      * Data di scadenza del pagamento
  21.      *
  22.      * @var \DateTime
  23.      *
  24.      * @ORM\Column(type="date")
  25.      */
  26.     private $data_scadenza;
  27.     /**
  28.      * Importo del pagamento
  29.      *
  30.      * @var double
  31.      *
  32.      * @ORM\Column(type="float")
  33.      */
  34.     private $importo;
  35.     /**
  36.      * Conto di saldo = ['not' o 'rev' o il nome del conto] ('not' indica che non è stato saldato, 'rev' che è stato stornato)
  37.      *
  38.      * @var string
  39.      *
  40.      * @ORM\Column(type="string")
  41.      */
  42.     private $metodo;
  43.     /**
  44.      * Data del saldo dell'importo indicato (se avvenuto)
  45.      *
  46.      * @var \DateTime|null
  47.      *
  48.      * @ORM\Column(type="date", nullable=true)
  49.      */
  50.     private $data_saldo;
  51.     public function __construct(DocumentoPagamentoResponse $pagamento)
  52.     {
  53.         $this->setDataScadenza($pagamento->getDataScadenza());
  54.         $this->setImporto($pagamento->getImporto());
  55.         $this->setMetodo($pagamento->getMetodo());
  56.         $this->setDataSaldo($pagamento->getDataSaldo());
  57.     }
  58.     /**
  59.      * @var DocumentoDettagliato
  60.      *
  61.      * @ORM\ManyToOne(targetEntity="DocumentoDettagliato", inversedBy="lista_pagamenti")
  62.      */
  63.     private $documento;
  64.     /**
  65.      * @return \DateTime
  66.      */
  67.     public function getDataScadenza(): \DateTime
  68.     {
  69.         return $this->data_scadenza;
  70.     }
  71.     /**
  72.      * @param \DateTime $data_scadenza
  73.      * @return DocumentoPagamento
  74.      */
  75.     public function setDataScadenza(\DateTime $data_scadenza): DocumentoPagamento
  76.     {
  77.         $this->data_scadenza $data_scadenza;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return float
  82.      */
  83.     public function getImporto(): float
  84.     {
  85.         return $this->importo;
  86.     }
  87.     /**
  88.      * @param float $importo
  89.      * @return DocumentoPagamento
  90.      */
  91.     public function setImporto(float $importo): DocumentoPagamento
  92.     {
  93.         $this->importo $importo;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return string
  98.      */
  99.     public function getMetodo(): string
  100.     {
  101.         return $this->metodo;
  102.     }
  103.     /**
  104.      * @param string $metodo
  105.      * @return DocumentoPagamento
  106.      */
  107.     public function setMetodo(string $metodo): DocumentoPagamento
  108.     {
  109.         $this->metodo $metodo;
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return \DateTime|null
  114.      */
  115.     public function getDataSaldo(): ?\DateTime
  116.     {
  117.         return $this->data_saldo;
  118.     }
  119.     /**
  120.      * @param \DateTime|null $data_saldo
  121.      * @return DocumentoPagamento
  122.      */
  123.     public function setDataSaldo(?\DateTime $data_saldo): DocumentoPagamento
  124.     {
  125.         $this->data_saldo $data_saldo;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return string
  130.      */
  131.     public function getId(): string
  132.     {
  133.         return $this->id;
  134.     }
  135.     /**
  136.      * @return DocumentoDettagliato
  137.      */
  138.     public function getDocumento(): DocumentoDettagliato
  139.     {
  140.         return $this->documento;
  141.     }
  142.     /**
  143.      * @param DocumentoDettagliato $documento
  144.      * @return DocumentoPagamento
  145.      */
  146.     public function setDocumento(DocumentoDettagliato $documento): DocumentoPagamento
  147.     {
  148.         $this->documento $documento;
  149.         return $this;
  150.     }
  151. }