function RulesDefaultEventHandler::getContextDefinition
Gets a specific context definition of the plugin.
Parameters
string $name: The name of the context in the plugin definition.
Return value
\Drupal\rules\Context\ContextDefinitionInterface The definition against which the context value must validate.
Overrides RulesEventHandlerInterface::getContextDefinition
File
-
src/
Core/ RulesDefaultEventHandler.php, line 27
Class
- RulesDefaultEventHandler
- Default event handler class.
Namespace
Drupal\rules\CoreCode
public function getContextDefinition($name) {
$definitions = $this->getContextDefinitions();
if (empty($definitions[$name])) {
throw new ContextException(sprintf("The context '%s' is not a valid context.", $name));
}
return $definitions[$name];
}