class CachedMockBlockManager

Defines a plugin manager used by Plugin API cache decorator web tests.

Hierarchy

Expanded class hierarchy of CachedMockBlockManager

2 files declare their use of CachedMockBlockManager
CacheDecoratorLanguageTest.php in drupal/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorLanguageTest.php
Contains Drupal\system\Tests\Plugin\CacheDecoratorLanguageTest.
plugin_test.module in drupal/core/modules/system/tests/modules/plugin_test/plugin_test.module
Helper module for the plugin tests.

File

drupal/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/CachedMockBlockManager.php, line 16
Contains Drupal\plugin_test\Plugin\CachedMockBlockManager.

Namespace

Drupal\plugin_test\Plugin
View source
class CachedMockBlockManager extends MockBlockManager {

  /**
   * Adds a cache decorator to the MockBlockManager's discovery.
   *
   * @see Drupal\plugin_test\Plugin\MockBlockManager::__construct().
   */
  public function __construct() {
    parent::__construct();

    // The CacheDecorator allows us to cache these plugin definitions for
    // quicker retrieval. In this case we are generating a cache key by
    // language.
    $this->discovery = new CacheDecorator($this->discovery, 'mock_block:' . language(Language::TYPE_INTERFACE)->langcode, 'cache', 1542646800, array(
      'plugin_test',
    ));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CachedMockBlockManager::__construct public function Adds a cache decorator to the MockBlockManager's discovery. Overrides MockBlockManager::__construct
PluginManagerBase::$defaults protected property A set of defaults to be referenced by $this->processDefinition() if additional processing of plugins is necessary or helpful for development purposes. 3
PluginManagerBase::$discovery protected property The object that discovers plugins managed by this manager.
PluginManagerBase::$factory protected property The object that instantiates plugins managed by this manager.
PluginManagerBase::$mapper protected property The object that returns the preconfigured plugin instance appropriate for a particular runtime condition.
PluginManagerBase::clearCachedDefinitions public function Clears static and persistent plugin definition caches. Overrides CachedDiscoveryInterface::clearCachedDefinitions
PluginManagerBase::createInstance public function Returns a preconfigured instance of a plugin. Overrides FactoryInterface::createInstance 6
PluginManagerBase::getDefinition public function Gets a specific plugin definition. Overrides DiscoveryInterface::getDefinition
PluginManagerBase::getDefinitions public function Gets the definition of all plugins for this type. Overrides DiscoveryInterface::getDefinitions
PluginManagerBase::getInstance public function Returns a preconfigured instance of a plugin. Overrides MapperInterface::getInstance 6
PluginManagerBase::processDefinition public function Performs extra processing on plugin definitions. 2