drupal_unpack
Definition
drupal_unpack($obj, $field = 'data')
includes/bootstrap.inc, line 496
Description
Unserializes and appends elements from a serialized string.
Parameters
$obj The object to which the elements are appended.
$field The attribute of $obj whose value should be unserialized.
Code
<?php
function drupal_unpack($obj, $field = 'data') {
if ($obj->$field && $data = unserialize($obj->$field)) {
foreach ($data as $key => $value) {
if (!isset($obj->$key)) {
$obj->$key = $value;
}
}
}
return $obj;
}
?> 