<?php
namespace App\AtechNet\CoreBundle\Entity;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\Table as Table;
/**
* @Table(name="billingo_payments")
* @Entity(repositoryClass="App\AtechNet\CoreBundle\Repository\BillingoPaymentRepository")
*/
class BillingoPayment extends AbstractSignedEntity
{
/**
* @var CustomerBillingoData
*
* @ManyToOne(targetEntity="CustomerBillingoData", inversedBy="payments")
* @JoinColumn(name="billingo_id", referencedColumnName="id", nullable=false)
*/
private $billingoData;
/**
* @var string
*
* @Column(name="amount", type="decimal", precision=10, scale=2)
*/
private $amount = 0;
/**
* @var string
*
* @Column(name="note", type="text", nullable=true)
*/
private $note;
/**
* @var int
*
* @Column(name="payment_source", type="integer")
*/
private $paymentSource = DocumentPayment::NOT_SELECTED;
/**
* @var \DateTime
*
* @Column(name="payment_date", type="datetime", nullable=true)
*/
private $paymentDate;
public function __construct()
{
$this->paymentDate = (new \DateTime())->setTime(0, 0);
}
/**
* @return CustomerBillingoData
*/
public function getBillingoData()
{
return $this->billingoData;
}
/**
* @param CustomerBillingoData $billingoData
*/
public function setBillingoData($billingoData)
{
$this->billingoData = $billingoData;
}
/**
* @return string
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param string $amount
* @return $this
*/
public function setAmount($amount)
{
$this->amount = str_replace(',', '.', $amount);
return $this;
}
/**
* @return int
*/
public function getNote()
{
return $this->note;
}
/**
* @param int $note
* @return $this
*/
public function setNote($note)
{
$this->note = $note;
return $this;
}
/**
* @return int
*/
public function getPaymentSource()
{
return $this->paymentSource;
}
/**
* @param int $paymentSource
*/
public function setPaymentSource($paymentSource)
{
$this->paymentSource = $paymentSource;
}
/**
* @return \DateTime
*/
public function getPaymentDate()
{
return $this->paymentDate;
}
/**
* @param \DateTime $paymentDate
*/
public function setPaymentDate($paymentDate)
{
$this->paymentDate = $paymentDate;
}
}