You are here

public function Context::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/sebastian/recursion-context/src/Context.php \SebastianBergmann\RecursionContext\Context::__construct()
  2. 8 core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context::__construct()
  3. 8 core/lib/Drupal/Component/Plugin/Context/Context.php \Drupal\Component\Plugin\Context\Context::__construct()
  4. 8 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php \phpDocumentor\Reflection\DocBlock\Context::__construct()
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context::__construct()

Create a context object.

Parameters

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

mixed $context_value|NULL: The context value object.

Overrides Context::__construct

File

core/lib/Drupal/Core/Plugin/Context/Context.php, line 53
Contains \Drupal\Core\Plugin\Context\Context.

Class

Context
A Drupal specific context wrapper class.

Namespace

Drupal\Core\Plugin\Context

Code

public function __construct(ContextDefinitionInterface $context_definition, $context_value = NULL) {
  parent::__construct($context_definition, NULL);
  $this->cacheabilityMetadata = new CacheableMetadata();
  if (!is_null($context_value)) {
    $this
      ->setContextValue($context_value);
  }
}