Add service type to invoice criteria #29

This commit is contained in:
Kendrick Chan 2018-02-27 12:17:29 +08:00
parent 2de5344288
commit 13adca3721

View file

@ -7,17 +7,31 @@ use App\Entity\Promo;
class InvoiceCriteria
{
protected $stype;
protected $batteries;
protected $promos;
protected $trade_in;
public function __construct()
{
$this->stype = 0;
$this->batteries = [];
$this->promos = [];
$this->trade_ins = [];
}
public function setServiceType($stype)
{
// TODO: validate service type
$this->$stype = $stype;
return $this;
}
public function getServiceType()
{
return $this->stype;
}
public function addBattery(Battery $battery, $qty = 1)
{
for ($i = 0; $i < $qty; $i++)