class PluginManager in Views (for Drupal 7) 8.3
Hierarchy
- class \Drupal\Component\Plugin\PluginManagerBase implements PluginManagerInterface uses DiscoveryTrait
- class \Drupal\views\Plugin\Type\PluginManager
Expanded class hierarchy of PluginManager
File
- lib/
Drupal/ views/ Plugin/ Type/ PluginManager.php, line 16 - Definition of Drupal\views\Plugin\Type\PluginManager.
Namespace
Drupal\views\Plugin\TypeView source
class PluginManager extends PluginManagerBase {
/**
* A list of Drupal core modules.
*
* @var array
*/
protected $coreModules = array();
/**
* Constructs a PluginManager object.
*/
public function __construct($type) {
// @todo Remove this hack in http://drupal.org/node/1708404.
views_init();
$this->discovery = new CacheDecorator(new AlterDecorator(new AnnotatedClassDiscovery('views', $type), 'views_plugins_' . $type), 'views:' . $type, 'views_info');
$this->factory = new DefaultFactory($this);
$this->coreModules = views_core_modules();
$this->defaults += array(
'parent' => 'parent',
'plugin_type' => $type,
);
}
/**
* Overrides Drupal\Component\Plugin\PluginManagerBase::processDefinition().
*/
public function processDefinition(&$definition, $plugin_id) {
parent::processDefinition($definition, $plugin_id);
$module = isset($definition['module']) ? $definition['module'] : 'views';
// If this module is a core module, use views as the module directory.
$module_dir = in_array($module, $this->coreModules) ? 'views' : $module;
$theme_path = drupal_get_path('module', $module_dir);
// Setup automatic path/file finding for theme registration.
if ($module_dir == 'views') {
$theme_path .= '/theme';
$theme_file = 'theme.inc';
}
else {
$theme_file = "{$module}.views.inc";
}
$definition += array(
'module' => $module_dir,
'theme path' => $theme_path,
'theme file' => $theme_file,
);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DiscoveryTrait:: |
protected | function | Gets a specific plugin definition. | |
DiscoveryTrait:: |
public | function | ||
PluginManager:: |
protected | property | A list of Drupal core modules. | |
PluginManager:: |
public | function | Overrides Drupal\Component\Plugin\PluginManagerBase::processDefinition(). | |
PluginManager:: |
public | function | Constructs a PluginManager object. | |
PluginManagerBase:: |
protected | property | The object that discovers plugins managed by this manager. | |
PluginManagerBase:: |
protected | property | The object that instantiates plugins managed by this manager. | |
PluginManagerBase:: |
protected | property | The object that returns the preconfigured plugin instance appropriate for a particular runtime condition. | |
PluginManagerBase:: |
public | function |
Creates a pre-configured instance of a plugin. Overrides FactoryInterface:: |
12 |
PluginManagerBase:: |
public | function |
Gets a specific plugin definition. Overrides DiscoveryTrait:: |
|
PluginManagerBase:: |
public | function |
Gets the definition of all plugins for this type. Overrides DiscoveryTrait:: |
|
PluginManagerBase:: |
protected | function | Gets the plugin discovery. | 1 |
PluginManagerBase:: |
protected | function | Gets the plugin factory. | 1 |
PluginManagerBase:: |
public | function |
Gets a preconfigured instance of a plugin. Overrides MapperInterface:: |
7 |
PluginManagerBase:: |
protected | function | Allows plugin managers to specify custom behavior if a plugin is not found. | 1 |