function Context::createFromContext
Overrides ContextInterface::createFromContext
1 call to Context::createFromContext()
- ContextAwarePluginTrait::setContextValue in core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php
File
-
core/
lib/ Drupal/ Core/ Plugin/ Context/ Context.php, line 174
Class
- Context
- A Drupal specific context wrapper class.
Namespace
Drupal\Core\Plugin\ContextCode
public static function createFromContext(ContextInterface $old_context, $value) {
$context = new static($old_context->getContextDefinition(), $value);
$context->addCacheableDependency($old_context);
if (method_exists($old_context, 'getTypedDataManager')) {
$context->setTypedDataManager($old_context->getTypedDataManager());
}
return $context;
}