You are here

public function RulesUiConfigHandler::getComponent in Rules 8.3

Gets the currently edited component.

Return value

\Drupal\rules\Engine\RulesComponent The edited component.

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);
  }
}