You are here

function bean_load_plugin_class in Bean (for Drupal 7) 7

Load a widget class

Parameters

$plugin_key string: the key fo the plugin

Return value

BeanTypePluginInterface | Boolean An instance of the bean class or FALSE if not loaded

7 calls to bean_load_plugin_class()
Bean::loadUp in includes/bean.core.inc
This is a work around for version of PDO that call __construct() before it loads up the object with values from the DB.
Bean::setUp in includes/bean.core.inc
Set up the object instance on construction or unserializiation.
BeanEntityAPIController::setPlugin in includes/bean.core.inc
BeanTestPlugins::testBeanLoadPlugin in tests/BeanTestPlugins.test
Test loading of the plugin.
bean_load_plugin_class_all in ./bean.module
Load all widget classes

... See full list

1 string reference to 'bean_load_plugin_class'
bean_bean_cache_clear in ./bean.module
Implements hook_bean_cache_clear().

File

./bean.module, line 467
Block Entity

Code

function bean_load_plugin_class($plugin_key = NULL) {
  $cache =& drupal_static(__FUNCTION__);
  if (!isset($cache[$plugin_key])) {
    ctools_include('plugins');
    $class = ctools_plugin_load_class('bean', 'types', $plugin_key, 'handler');
    if ($class && bean_check_plugin_class($class)) {
      $cache[$plugin_key] = new $class(bean_fetch_plugin_info($plugin_key));
    }
  }
  return isset($cache[$plugin_key]) ? $cache[$plugin_key] : FALSE;
}