예제 #1
0
 /**
  * Load from Store.
  */
 public function loadFromStore()
 {
     $data = $this->store->get($this->id);
     // exclude accept tos
     unset($data['accept_tos']);
     $this->load($data);
 }
예제 #2
0
파일: Cart.php 프로젝트: falkbizz/cart
 /**
  * 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);
     }
 }