You are here

public function Context::__construct in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Component/Plugin/Context/Context.php \Drupal\Component\Plugin\Context\Context::__construct()

Create a context object.

Parameters

\Drupal\Component\Plugin\Context\ContextDefinitionInterface $context_definition: The context definition.

mixed|null $context_value: The value of the context.

File

lib/Drupal/Component/Plugin/Context/Context.php, line 41
Contains \Drupal\Component\Plugin\Context\Context.

Class

Context
A generic context class for wrapping data a plugin needs to operate.

Namespace

Drupal\Component\Plugin\Context

Code

public function __construct(ContextDefinitionInterface $context_definition, $context_value = NULL) {
  $this->contextDefinition = $context_definition;
  $this->contextValue = $context_value;
}