You are here

public function ContextProviderTrait::getProvidedContextDefinition in Rules 8.3

See also

\Drupal\rules\Context\ContextProviderInterface

1 call to ContextProviderTrait::getProvidedContextDefinition()
ContextProviderTrait::getProvidedContext in src/Context/ContextProviderTrait.php

File

src/Context/ContextProviderTrait.php, line 52

Class

ContextProviderTrait
A trait implementing the ContextProviderInterface.

Namespace

Drupal\rules\Context

Code

public function getProvidedContextDefinition($name) {
  $definition = $this
    ->getPluginDefinition();
  if (empty($definition['provides'][$name])) {
    throw new ContextException(sprintf("The provided context '%s' is not valid.", $name));
  }
  return $definition['provides'][$name];
}