function views_db_object::load_row

Same name in other branches
  1. 7.x-3.x 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

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