function RulesUiConfigHandler::getComponent

Overrides RulesUiHandlerInterface::getComponent

File

src/Ui/RulesUiConfigHandler.php, line 111

Class

RulesUiConfigHandler
The default handler for RulesUi plugins that store to config.

Namespace

Drupal\rules\Ui

Code

public function getComponent() {
    $config = $this->getConfig();
    if ($config instanceof RulesUiComponentProviderInterface) {
        return $config->getComponent();
    }
    else {
        $configuration = $config->get($this->pluginDefinition->settings['config_key']);
        return RulesComponent::createFromConfiguration($configuration);
    }
}