function ContextAwarePluginInterface::setContextMapping

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface::setContextMapping()
  2. 8.9.x core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface::setContextMapping()
  3. 10 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface::setContextMapping()

Sets a mapping of the expected assignment names to their context names.

Parameters

array $context_mapping: A mapping of the expected assignment names to their context names. For example, if one of the $contexts is named 'user.current_user', but the plugin expects a context named 'user', then this map would contain 'user' => 'user.current_user'.

Return value

$this

File

core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php, line 145

Class

ContextAwarePluginInterface
Interface for defining context aware plugins.

Namespace

Drupal\Component\Plugin

Code

public function setContextMapping(array $context_mapping);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.