You are here

public function Webform::summary in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/Condition/Webform.php \Drupal\webform\Plugin\Condition\Webform::summary()

Provides a human readable summary of the condition's configuration.

Overrides ConditionInterface::summary

File

src/Plugin/Condition/Webform.php, line 143

Class

Webform
Provides a 'Webform' condition.

Namespace

Drupal\webform\Plugin\Condition

Code

public function summary() {
  if (count($this->configuration['webforms']) > 1) {
    $webforms = $this->configuration['webforms'];
    $last = array_pop($webforms);
    $webforms = implode(', ', $webforms);
    return $this
      ->t('The webform is @webforms or @last', [
      '@webforms' => $webforms,
      '@last' => $last,
    ]);
  }
  $webform = reset($this->configuration['webforms']);
  return $this
    ->t('The webform is @webform', [
    '@webform' => $webform,
  ]);
}