class CategorizingPluginManager
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManager
- 10 core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManager
- 9 core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManager
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManager
Class that allows testing the trait.
Hierarchy
- class \Drupal\Component\Plugin\PluginManagerBase implements \Drupal\Component\Plugin\PluginManagerInterface uses \Drupal\Component\Plugin\Discovery\DiscoveryTrait
- class \Drupal\Core\Plugin\DefaultPluginManager implements \Drupal\Component\Plugin\PluginManagerInterface, \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait, \Drupal\Core\Cache\UseCacheBackendTrait extends \Drupal\Component\Plugin\PluginManagerBase
- class \Drupal\Tests\Core\Plugin\CategorizingPluginManager implements \Drupal\Component\Plugin\CategorizingPluginManagerInterface uses \Drupal\Core\Plugin\CategorizingPluginManagerTrait extends \Drupal\Core\Plugin\DefaultPluginManager
- class \Drupal\Core\Plugin\DefaultPluginManager implements \Drupal\Component\Plugin\PluginManagerInterface, \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait, \Drupal\Core\Cache\UseCacheBackendTrait extends \Drupal\Component\Plugin\PluginManagerBase
Expanded class hierarchy of CategorizingPluginManager
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ CategorizingPluginManagerTraitTest.php, line 119
Namespace
Drupal\Tests\Core\PluginView source
class CategorizingPluginManager extends DefaultPluginManager implements CategorizingPluginManagerInterface {
use CategorizingPluginManagerTrait;
/**
* Replace the constructor so we can instantiate a stub.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\Extension\ModuleExtensionList $module_extension_list
* The module extension list.
*/
public function __construct(ModuleHandlerInterface $module_handler, ModuleExtensionList $module_extension_list) {
$this->moduleHandler = $module_handler;
$this->moduleExtensionList = $module_extension_list;
}
/**
* {@inheritdoc}
*
* Provides some test definitions to the trait.
*/
public function getDefinitions() : array {
return [
'cucumber' => [
'label' => 'cucumber',
'category' => 'vegetables',
],
'apple' => [
'label' => 'apple',
'category' => 'fruits',
],
'mango' => [
'label' => 'mango',
'category' => 'fruits',
],
];
}
/**
* {@inheritdoc}
*/
public function processDefinition(&$definition, $plugin_id) : void {
parent::processDefinition($definition, $plugin_id);
$this->processDefinitionCategory($definition);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.