function ConditionExpression::getLabel

Overrides ExpressionBase::getLabel

1 call to ConditionExpression::getLabel()
ConditionExpression::executeWithState in src/Plugin/RulesExpression/ConditionExpression.php
Execute the expression with a given Rules state.

File

src/Plugin/RulesExpression/ConditionExpression.php, line 157

Class

ConditionExpression
Defines an executable condition expression.

Namespace

Drupal\rules\Plugin\RulesExpression

Code

public function getLabel() {
  if (!empty($this->configuration['condition_id'])) {
    $definition = $this->conditionManager
      ->getDefinition($this->configuration['condition_id']);
    if ($this->isNegated()) {
      return $this->t('@not @label', [
        '@not' => $this->t('NOT'),
        '@label' => $definition['label'],
      ]);
    }
    else {
      return $definition['label'];
    }
  }
  return parent::getLabel();
}