function views_load_display_records

cis7 views.module views_load_display_records(&$views)
cle7 views.module views_load_display_records(&$views)
elmsmedia7 views.module views_load_display_records(&$views)
icor7 views.module views_load_display_records(&$views)
meedjum_blog7 views.module views_load_display_records(&$views)
mooc7 views.module views_load_display_records(&$views)

Export callback to load the view subrecords, which are the displays.

1 string reference to 'views_load_display_records'
views_schema_6000 in sites/all/modules/ulmus/views/views.install
Views 2's initial schema. Called directly by views_update_6000() for updates from Drupal 5.

File

sites/all/modules/ulmus/views/views.module, line 1594
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_load_display_records(&$views) {
  // Get vids from the views.
  $names = array();
  foreach ($views as $view) {
    if (empty($view->display)) {
      $names[$view->vid] = $view->name;
    }
  }

  if (empty($names)) {
    return;
  }

  foreach (view::db_objects() as $key) {
    $object_name = "views_$key";
    $result = db_query("SELECT * FROM {{$object_name}} WHERE vid IN (:vids) ORDER BY vid, position", array(':vids' => array_keys($names)));

    foreach ($result as $data) {
      $object = new $object_name(FALSE);
      $object->load_row($data);

      // Because it can get complicated with this much indirection,
      // make a shortcut reference.
      $location = &$views[$names[$object->vid]]->$key;

      // If we have a basic id field, load the item onto the view based on
      // this ID, otherwise push it on.
      if (!empty($object->id)) {
        $location[$object->id] = $object;
      }
      else {
        $location[] = $object;
      }
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.