function drupal_unpack

7.x bootstrap.inc drupal_unpack($obj, $field = 'data')
6.x bootstrap.inc 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.

6 calls to drupal_unpack()
comment_edit in drupal-6.x/modules/comment/comment.pages.inc
Form builder; generate a comment editing form.
comment_form_add_preview in drupal-6.x/modules/comment/comment.module
Form builder; Generate and validate a comment preview form.
comment_render in drupal-6.x/modules/comment/comment.module
Renders comment(s).
comment_reply in drupal-6.x/modules/comment/comment.pages.inc
This function is responsible for generating a comment reply form. There are several cases that have to be handled, including:
sess_read in drupal-6.x/includes/session.inc
Reads an entire session from the database (internal use only).

... See full list

File

drupal-6.x/includes/bootstrap.inc, line 811
Functions that need to be loaded on every Drupal request.

Code

function drupal_unpack($obj, $field = 'data') {
  if ($obj->$field && $data = unserialize($obj->$field)) {
    foreach ($data as $key => $value) {
      if (!empty($key) && !isset($obj->$key)) {
        $obj->$key = $value;
      }
    }
  }
  return $obj;
}