1 entityreference.module entityreference_get_accessible_behavior_plugins($field, $instance)

Get all accessible behavior plugins.

File

core/modules/entityreference/entityreference.module, line 629
Entityreference primary module file.

Code

function entityreference_get_accessible_behavior_plugins($field, $instance) {
  $plugins = array('field' => array(), 'instance' => array());
  foreach (_entityreference_behavior_plugins() as $name => $plugin) {
    $handler = _entityreference_get_behavior_handler($name);
    $level = $plugin['behavior type'];
    if ($handler->access($field, $instance)) {
      $plugins[$level][$name] = $plugin;
    }
  }
  return $plugins;
}