src/AtechNet/CoreBundle/Entity/BillingoPayment.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\Entity;
  5. use Doctrine\ORM\Mapping\JoinColumn;
  6. use Doctrine\ORM\Mapping\ManyToOne;
  7. use Doctrine\ORM\Mapping\Table as Table;
  8. /**
  9.  * @Table(name="billingo_payments")
  10.  * @Entity(repositoryClass="App\AtechNet\CoreBundle\Repository\BillingoPaymentRepository")
  11.  */
  12. class BillingoPayment extends AbstractSignedEntity
  13. {
  14.     /**
  15.      * @var CustomerBillingoData
  16.      *
  17.      * @ManyToOne(targetEntity="CustomerBillingoData", inversedBy="payments")
  18.      * @JoinColumn(name="billingo_id", referencedColumnName="id", nullable=false)
  19.      */
  20.     private $billingoData;
  21.     /**
  22.      * @var string
  23.      *
  24.      * @Column(name="amount", type="decimal", precision=10, scale=2)
  25.      */
  26.     private $amount = 0;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @Column(name="note", type="text", nullable=true)
  31.      */
  32.     private $note;
  33.     /**
  34.      * @var int
  35.      *
  36.      * @Column(name="payment_source", type="integer")
  37.      */
  38.     private $paymentSource = DocumentPayment::NOT_SELECTED;
  39.     /**
  40.      * @var \DateTime
  41.      *
  42.      * @Column(name="payment_date", type="datetime", nullable=true)
  43.      */
  44.     private $paymentDate;
  45.     public function __construct()
  46.     {
  47.         $this->paymentDate = (new \DateTime())->setTime(0, 0);
  48.     }
  49.     /**
  50.      * @return CustomerBillingoData
  51.      */
  52.     public function getBillingoData()
  53.     {
  54.         return $this->billingoData;
  55.     }
  56.     /**
  57.      * @param CustomerBillingoData $billingoData
  58.      */
  59.     public function setBillingoData($billingoData)
  60.     {
  61.         $this->billingoData = $billingoData;
  62.     }
  63.     /**
  64.      * @return string
  65.      */
  66.     public function getAmount()
  67.     {
  68.         return $this->amount;
  69.     }
  70.     /**
  71.      * @param string $amount
  72.      * @return $this
  73.      */
  74.     public function setAmount($amount)
  75.     {
  76.         $this->amount = str_replace(',', '.', $amount);
  77.         return $this;
  78.     }
  79.     /**
  80.      * @return int
  81.      */
  82.     public function getNote()
  83.     {
  84.         return $this->note;
  85.     }
  86.     /**
  87.      * @param int $note
  88.      * @return $this
  89.      */
  90.     public function setNote($note)
  91.     {
  92.         $this->note = $note;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return int
  97.      */
  98.     public function getPaymentSource()
  99.     {
  100.         return $this->paymentSource;
  101.     }
  102.     /**
  103.      * @param int $paymentSource
  104.      */
  105.     public function setPaymentSource($paymentSource)
  106.     {
  107.         $this->paymentSource = $paymentSource;
  108.     }
  109.     /**
  110.      * @return \DateTime
  111.      */
  112.     public function getPaymentDate()
  113.     {
  114.         return $this->paymentDate;
  115.     }
  116.     /**
  117.      * @param \DateTime $paymentDate
  118.      */
  119.     public function setPaymentDate($paymentDate)
  120.     {
  121.         $this->paymentDate = $paymentDate;
  122.     }
  123. }