class RulesDefaultEventHandler

Default event handler class.

Hierarchy

Expanded class hierarchy of RulesDefaultEventHandler

1 file declares its use of RulesDefaultEventHandler
ConfigurableEventHandlerBase.php in src/EventHandler/ConfigurableEventHandlerBase.php

File

src/Core/RulesDefaultEventHandler.php, line 11

Namespace

Drupal\rules\Core
View source
class RulesDefaultEventHandler extends PluginBase implements RulesEventHandlerInterface {
    
    /**
     * {@inheritdoc}
     */
    public function getContextDefinitions() {
        $definition = $this->getPluginDefinition();
        if ($this instanceof RulesConfigurableEventHandlerInterface) {
            $this->refineContextDefinitions();
        }
        return !empty($definition['context_definitions']) ? $definition['context_definitions'] : [];
    }
    
    /**
     * {@inheritdoc}
     */
    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];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
RulesDefaultEventHandler::getContextDefinition public function Gets a specific context definition of the plugin. Overrides RulesEventHandlerInterface::getContextDefinition
RulesDefaultEventHandler::getContextDefinitions public function Gets the context definitions of the event. Overrides RulesEventHandlerInterface::getContextDefinitions