function views_db_object::load_row

3.x view.inc views_db_object::load_row($data)
2.x view.inc views_db_object::load_row($data)

Load the object with a row from the database.

This method is separate from the constructor in order to give us more flexibility in terms of how the view object is built in different contexts.

Parameters

$data: An object from db_fetch_object. It should contain all of the fields that are in the schema.

1 call to views_db_object::load_row()
views_db_object::init in includes/view.inc
Initialize this object, setting values from schema defaults.

File

includes/view.inc, line 1796
view.inc Provides the view object type and associated methods.

Class

views_db_object
Base class for views' database objects.

Code

function load_row($data) {
  $schema = drupal_get_schema($this->db_table);

  // Go through our schema and build correlations.
  foreach ($schema['fields'] as $field => $info) {
    $this->$field = empty($info['serialize']) ? $data->$field : unserialize(db_decode_blob($data->$field));
  }
}