You are here

function views_get_handler in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 8.3 views.module \views_get_handler()
  2. 6.3 views.module \views_get_handler()
  3. 7.3 views.module \views_get_handler()

Fetch a handler from the data cache.

Parameters

$table: The name of the table this handler is from.

$field: The name of the field this handler is from.

$key: The type of handler. i.e, sort, field, argument, filter, relationship

Return value

views_handler An instance of a handler object. May be views_handler_broken.

12 calls to views_get_handler()
template_preprocess_views_ui_edit_item in includes/admin.inc
Add information about a section to a display.
views1_import in includes/convert.inc
Convert a Views 1 view to a Views 2 view.
views_db_object::add_item in includes/view.inc
Add an item with a handler to the view.
views_plugin_display::get_handlers in plugins/views_plugin_display.inc
Get a full array of handlers for $type. This caches them.
views_plugin_row::options_form in plugins/views_plugin_row.inc
Provide a form for setting options.

... See full list

File

./views.module, line 683
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_get_handler($table, $field, $key) {
  $data = views_fetch_data($table);
  if (isset($data[$field][$key])) {

    // Set up a default handler:
    if (empty($data[$field][$key]['handler'])) {
      $data[$field][$key]['handler'] = 'views_handler_' . $key;
    }
    return _views_prepare_handler($data[$field][$key], $data, $field);
  }

  // DEBUG -- identify missing handlers
  vpr("Missing handler: {$table} {$field} {$key}");
  $broken = array(
    'title' => t('Broken handler @table.@field', array(
      '@table' => $table,
      '@field' => $field,
    )),
    'handler' => 'views_handler_' . $key . '_broken',
    'table' => $table,
    'field' => $field,
  );
  return _views_create_handler($broken);
}