class MockComplexContextBlock

Implementation of a complex context plugin used by Plugin API context tests.

Hierarchy

Expanded class hierarchy of MockComplexContextBlock

See also

\Drupal\plugin_test\Plugin\MockBlockManager

File

drupal/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockComplexContextBlock.php, line 17
Contains \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockComplexContextBlock.

Namespace

Drupal\plugin_test\Plugin\plugin_test\mock_block
View source
class MockComplexContextBlock extends ContextAwarePluginBase {
  public function getTitle() {
    $user = $this
      ->getContextValue('user');
    $node = $this
      ->getContextValue('node');
    return $user
      ->label() . ' -- ' . $node
      ->label();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContextAwarePluginBase::$context protected property The data objects representing the context of this plugin.
ContextAwarePluginBase::getContext public function Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::getContext(). Overrides ContextAwarePluginInterface::getContext
ContextAwarePluginBase::getContextDefinition public function Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::getContextDefinition(). Overrides ContextAwarePluginInterface::getContextDefinition
ContextAwarePluginBase::getContextDefinitions public function Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::getContextDefinitions(). Overrides ContextAwarePluginInterface::getContextDefinitions
ContextAwarePluginBase::getContexts public function Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::getContexts(). Overrides ContextAwarePluginInterface::getContexts
ContextAwarePluginBase::getContextValue public function Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::getContextValue(). Overrides ContextAwarePluginInterface::getContextValue
ContextAwarePluginBase::getContextValues public function Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::getContextValues(). Overrides ContextAwarePluginInterface::getContextValues
ContextAwarePluginBase::setContextValue public function Override of \Drupal\Component\Plugin\ContextAwarePluginBase::setContextValue(). Overrides ContextAwarePluginBase::setContextValue
ContextAwarePluginBase::validateContexts public function Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::valdidateContexts(). Overrides ContextAwarePluginInterface::validateContexts
ContextAwarePluginBase::__construct public function Override of \Drupal\Component\Plugin\ContextAwarePluginBase::__construct(). Overrides ContextAwarePluginBase::__construct
MockComplexContextBlock::getTitle public function
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::getPluginDefinition public function Returns the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId