You are here

public function ContextAwarePluginTrait::getContextMapping in Drupal 10

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php \Drupal\Core\Plugin\ContextAwarePluginTrait::getContextMapping()

File

core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php, line 96

Class

ContextAwarePluginTrait
Provides a trait to add context-aware functionality to plugins.

Namespace

Drupal\Core\Plugin

Code

public function getContextMapping() {
  $configuration = $this instanceof ConfigurableInterface ? $this
    ->getConfiguration() : $this->configuration;
  return $configuration['context_mapping'] ?? [];
}