You are here

public static function ContextInterface::createFromContext in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/Context/ContextInterface.php \Drupal\Core\Plugin\Context\ContextInterface::createFromContext()
  2. 9 core/lib/Drupal/Core/Plugin/Context/ContextInterface.php \Drupal\Core\Plugin\Context\ContextInterface::createFromContext()

Creates a new context with a different value.

Parameters

\Drupal\Core\Plugin\Context\ContextInterface $old_context: The context object used to create a new object. Cacheability metadata will be copied over.

mixed $value: The value of the new context object.

Return value

static

1 method overrides ContextInterface::createFromContext()
Context::createFromContext in core/lib/Drupal/Core/Plugin/Context/Context.php
Creates a new context with a different value.

File

core/lib/Drupal/Core/Plugin/Context/ContextInterface.php, line 59

Class

ContextInterface
Context data and definitions for plugins supporting caching and return docs.

Namespace

Drupal\Core\Plugin\Context

Code

public static function createFromContext(ContextInterface $old_context, $value);