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 class InvoiceCriteria
{ {
protected $stype;
protected $batteries; protected $batteries;
protected $promos; protected $promos;
protected $trade_in; protected $trade_in;
public function __construct() public function __construct()
{ {
$this->stype = 0;
$this->batteries = []; $this->batteries = [];
$this->promos = []; $this->promos = [];
$this->trade_ins = []; $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) public function addBattery(Battery $battery, $qty = 1)
{ {
for ($i = 0; $i < $qty; $i++) for ($i = 0; $i < $qty; $i++)