function 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

object $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 2335

Class

views_db_object
Base class for views' database objects.

Code

public 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($data->{$field});
    }
}