From 13adca3721afba3d8a18327f7bdb4db45f411271 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Tue, 27 Feb 2018 12:17:29 +0800 Subject: [PATCH] Add service type to invoice criteria #29 --- src/Ramcar/InvoiceCriteria.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Ramcar/InvoiceCriteria.php b/src/Ramcar/InvoiceCriteria.php index 777d188b..e6379997 100644 --- a/src/Ramcar/InvoiceCriteria.php +++ b/src/Ramcar/InvoiceCriteria.php @@ -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++)