本文整理汇总了PHP中ActiveRecordModel::unserialize方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecordModel::unserialize方法的具体用法?PHP ActiveRecordModel::unserialize怎么用?PHP ActiveRecordModel::unserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecordModel
的用法示例。
在下文中一共展示了ActiveRecordModel::unserialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unserialize
public function unserialize($serialized)
{
parent::unserialize($serialized);
if ($this->serializedState) {
$this->state->set(State::getInstanceByID($this->serializedState, true));
}
}
示例2: unserialize
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: unserialize
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: unserialize
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();
}
}