public function ContextAwarePluginBase::getContextValues

Implements \Drupal\Component\Plugin\ContextAwarePluginInterface::getContextValues().

Overrides ContextAwarePluginInterface::getContextValues

File

drupal/core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php, line 107
Contains \Drupal\Component\Plugin\ContextAwarePluginBase

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Component\Plugin

Code

public function getContextValues() {
  $values = array();
  foreach ($this
    ->getContextDefinitions() as $name => $definition) {
    $values[$name] = isset($this->context[$name]) ? $this->context[$name]
      ->getContextValue() : NULL;
  }
  return $values;
}