function RulesUiConfigHandler::getComponentLabel

Overrides RulesUiHandlerInterface::getComponentLabel

File

src/Ui/RulesUiConfigHandler.php, line 96

Class

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

Namespace

Drupal\rules\Ui

Code

public function getComponentLabel() {
    if (isset($this->pluginDefinition->component_label)) {
        return $this->pluginDefinition->component_label;
    }
    elseif ($this->getConfig() instanceof EntityInterface) {
        return $this->getConfig()
            ->label();
    }
    else {
        return $this->pluginDefinition->component_type_label;
    }
}