public function unserialize($serialized) { parent::unserialize($serialized); if ($this->serializedState) { $this->state->set(State::getInstanceByID($this->serializedState, true)); } }
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); }
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})); } } }
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(); } }