You are here

function views_db_object::load_row in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 includes/view.inc \views_db_object::load_row()
  2. 7.3 includes/view.inc \views_db_object::load_row()

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 2091
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}));
  }
}