예제 #1
0
 public function unserialize($serialized)
 {
     parent::unserialize($serialized);
     if ($this->serializedState) {
         $this->state->set(State::getInstanceByID($this->serializedState, true));
     }
 }
예제 #2
0
 public function unserialize($serialized)
 {
     parent::unserialize($serialized);
     // load products
     $productIds = array();
     foreach ($this->orderedItems as $item) {
         $productIds[] = $item->getProduct()->getID();
     }
     $products = ActiveRecordModel::getInstanceArray('Product', $productIds, Product::LOAD_REFERENCES);
     // load product prices
     $set = new ARSet();
     foreach ($products as $product) {
         $set->add($product);
     }
     ProductPrice::loadPricesForRecordSet($set);
 }
예제 #3
0
파일: User.php 프로젝트: saiber/livecart
 public function unserialize($serialized)
 {
     //die($serialized);
     parent::unserialize($serialized);
     foreach (array('defaultShippingAddressID', 'defaultBillingAddressID') as $addr) {
         $addr = substr($addr, 0, -2);
         $key = 'addr_' . $addr;
         if ($this->{$key}) {
             $class = substr($addr, 7);
             $this->{$addr}->set($class::getNewInstance($this, $this->{$key}));
         }
     }
 }
예제 #4
0
 public function unserialize($serialized)
 {
     parent::unserialize($serialized);
     if ($this->availableShippingRates) {
         foreach ($this->availableShippingRates as $rate) {
             $rate->setApplication($this->getApplication());
         }
     }
     if ($this->itemIds) {
         $this->items = array();
         foreach ($this->itemIds as $id) {
             if ($id) {
                 try {
                     $this->items[] = ActiveRecordModel::getInstanceById('OrderedItem', $id, ActiveRecordModel::LOAD_DATA);
                 } catch (ARNotFoundException $e) {
                 }
             }
         }
         $this->itemIds = array();
     }
 }