function views_db_object::add_item

cis7 view.inc views_db_object::add_item($display_id, $type, $table, $field, $options = array(), $id = NULL)
cle7 view.inc views_db_object::add_item($display_id, $type, $table, $field, $options = array(), $id = NULL)
elmsmedia7 view.inc views_db_object::add_item($display_id, $type, $table, $field, $options = array(), $id = NULL)
icor7 view.inc views_db_object::add_item($display_id, $type, $table, $field, $options = array(), $id = NULL)
meedjum_blog7 view.inc views_db_object::add_item($display_id, $type, $table, $field, $options = array(), $id = NULL)
mooc7 view.inc views_db_object::add_item($display_id, $type, $table, $field, $options = array(), $id = NULL)

Add an item with a handler to the view.

These items may be fields, filters, sort criteria, or arguments.

1 call to views_db_object::add_item()
view::fix_missing_relationships in sites/all/modules/ulmus/views/includes/view.inc
Attempt to discover if the view has handlers missing relationships.

File

sites/all/modules/ulmus/views/includes/view.inc, line 2446
Provides the view object type and associated methods.

Class

views_db_object
Base class for views' database objects.

Code

function add_item($display_id, $type, $table, $field, $options = array(), $id = NULL) {
  $types = views_object_types();
  $this->set_display($display_id);

  $fields = $this->display[$display_id]->handler->get_option($types[$type]['plural']);

  if (empty($id)) {
    $id = $this->generate_item_id($field, $fields);
  }

  $new_item = array(
    'id' => $id,
    'table' => $table,
    'field' => $field,
  ) + $options;

  if (!empty($types[$type]['type'])) {
    $handler_type = $types[$type]['type'];
  }
  else {
    $handler_type = $type;
  }

  $handler = views_get_handler($table, $field, $handler_type);

  $fields[$id] = $new_item;
  $this->display[$display_id]->handler->set_option($types[$type]['plural'], $fields);

  return $id;
}
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.