stype = 0; $this->promos = []; $this->entries = []; } 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++) $this->batteries[] = $battery; return $this; } public function getBatteries() { return $this->batteries; } */ public function addPromo(Promo $promo) { $this->promos[] = $promo; return $this; } public function getPromos() { return $this->promos; } /* public function addTradeIn($is_motolite, $qty = 1) { // NOTE: this asumes that all the rates for trade-ins are standardized // for motolite and non-motolite trade-ins for ($i = 0; $i < $qty; $i++) { if ($is_motolite) $trade_in = 'motolite'; else $trade_in = 'other'; $this->trade_ins[] = $trade_in; } return $this; } public function getTradeIns() { return $this->trade_ins; } */ public function addEntry($battery, $trade_in, $qty) { // trade_in is null if no trade_in specified $entry = [ 'battery' => $battery, 'trade_in' => $trade_in, 'qty' => $qty ]; $this->entries[] = $entry; } public function getEntries() { return $this->entries; } }