You are here

function _entityreference_get_behavior_handler in Entity reference 7

Get the behavior handler for a given entityreference field and instance.

Parameters

$behavior: The behavior handler name.

3 calls to _entityreference_get_behavior_handler()
entityreference_get_accessible_behavior_plugins in ./entityreference.module
Get all accessible behavior plugins.
entityreference_get_behavior_handlers in ./entityreference.module
Get the behavior handlers for a given entityreference field.
_entityreference_get_behavior_elements in ./entityreference.module
Get the field or instance elements for the field configuration.

File

./entityreference.module, line 190
Entityreference primary module file.

Code

function _entityreference_get_behavior_handler($behavior) {
  $object_cache = drupal_static(__FUNCTION__);
  if (!isset($object_cache[$behavior])) {
    ctools_include('plugins');
    $class = ctools_plugin_load_class('entityreference', 'behavior', $behavior, 'class');
    $class = class_exists($class) ? $class : 'EntityReference_BehaviorHandler_Broken';
    $object_cache[$behavior] = new $class($behavior);
  }
  return $object_cache[$behavior];
}