You are here

function backup_migrate_item::load_row in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.2 includes/crud.inc \backup_migrate_item::load_row()
  2. 8.3 includes/crud.inc \backup_migrate_item::load_row()
  3. 6.2 includes/crud.inc \backup_migrate_item::load_row()
  4. 7.3 includes/crud.inc \backup_migrate_item::load_row()
  5. 7.2 includes/crud.inc \backup_migrate_item::load_row()

Load an existing item from an database (serialized) array.

File

includes/crud.inc, line 525
CRUD functions for backup and migrate types (schedules, profiles etc.).

Class

backup_migrate_item
A base class for items which can be stored in the database, listed, edited, deleted etc.

Code

function load_row($data) {
  $params = array();
  $schema = $this
    ->get_schema();

  // Load fields as specified in the schema.
  foreach ($schema['fields'] as $field => $info) {
    $params[$field] = empty($info['serialize']) ? $data[$field] : unserialize(db_decode_blob($data[$field]));
  }
  $this
    ->from_array($params);
}