function _views_create_handler

cis7 handlers.inc _views_create_handler($definition, $type = 'handler', $handler_type = NULL)
cle7 handlers.inc _views_create_handler($definition, $type = 'handler', $handler_type = NULL)
elmsmedia7 handlers.inc _views_create_handler($definition, $type = 'handler', $handler_type = NULL)
icor7 handlers.inc _views_create_handler($definition, $type = 'handler', $handler_type = NULL)
meedjum_blog7 handlers.inc _views_create_handler($definition, $type = 'handler', $handler_type = NULL)
mooc7 handlers.inc _views_create_handler($definition, $type = 'handler', $handler_type = NULL)

Instantiate and construct a new handler

3 calls to _views_create_handler()
views_get_handler in sites/all/modules/ulmus/views/views.module
Fetch a handler from the data cache.
views_get_plugin in sites/all/modules/ulmus/views/views.module
Get a handler for a plugin
_views_prepare_handler in sites/all/modules/ulmus/views/includes/handlers.inc
Prepare a handler's data by checking defaults and such.

File

sites/all/modules/ulmus/views/includes/handlers.inc, line 11
Defines the various handler objects to help build and display views.

Code

function _views_create_handler($definition, $type = 'handler', $handler_type = NULL) {
  //  debug('Instantiating handler ' . $definition['handler']);
  if (empty($definition['handler'])) {
    vpr('_views_create_handler - type: @type - failed: handler has not been provided.', array('@type' => isset($handler_type) ? ($type . '(handler type: ' . $handler_type . ')') : $type));
    return;
  }

  // class_exists will automatically load the code file.
  if (!empty($definition['override handler']) && !class_exists($definition['override handler'])) {
    vpr('_views_create_handler - loading override handler @type failed: class @override_handler could not be loaded. ' . 'Verify the class file has been registered in the corresponding .info-file (files[]).', array(
      '@type' => isset($handler_type) ? ($type . '(handler type: ' . $handler_type . ')') : $type,
      '@override_handler' => $definition['override handler'],
    ));
    return;
  }

  if (!class_exists($definition['handler'])) {
    vpr('_views_create_handler - loading handler @type failed: class @handler could not be loaded. ' . 'Verify the class file has been registered in the corresponding .info-file (files[]).', array(
      '@type' => isset($handler_type) ? ($type . '(handler type: ' . $handler_type . ')') : $type,
      '@handler' => $definition['handler'],
    ));
    return;
  }

  if (!empty($definition['override handler'])) {
    $handler = new $definition['override handler'];
  }
  else {
    $handler = new $definition['handler'];
  }

  $handler->set_definition($definition);
  if ($type == 'handler') {
    $handler->is_handler = TRUE;
    $handler->handler_type = $handler_type;
  }
  else {
    $handler->is_plugin = TRUE;
    $handler->plugin_type = $type;
    $handler->plugin_name = $definition['name'];
  }

  // let the handler have something like a constructor.
  $handler->construct();

  return $handler;
}