/** * Load from Store. */ public function loadFromStore() { $data = $this->store->get($this->id); // exclude accept tos unset($data['accept_tos']); $this->load($data); }
/** * Restore the cart from its saved state. * * @throws CartRestoreException */ public function restore() { $state = $this->store->get($this->id); $data = @unserialize($state); // suppress unserializable error $this->restoreCheckType($data); $this->restoreCheckContents($data); $this->restoreCheckContentsType($data); $this->id = $data['id']; $this->items = array(); foreach ($data['items'] as $itemArr) { $this->items[] = new $itemArr['__class']($itemArr); } }