public function decrement($itemHash) { $item = $this->getItem($itemHash); if ($item->qty > 1) { $item->qty--; $this->update(); return $item; } $this->removeItem($itemHash); $this->update(); }