drupal_unpack

Versions
4.6 – 7
drupal_unpack($obj, $field = 'data')

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.

▾ 8 functions call drupal_unpack()

comment_admin_edit in modules/comment.module
Menu callback; edit a comment from the administrative interface.
comment_edit in modules/comment.module
comment_preview in modules/comment.module
comment_render in modules/comment.module
comment_reply in modules/comment.module
node_load in modules/node.module
Load a node object from the database.
sess_read in includes/session.inc
user_load in modules/user.module
Fetch a user object.

Code

includes/bootstrap.inc, line 496

<?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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.