You are here

public function PanopolySearchCondition::summary in Panopoly Search 8.2

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

Overrides ConditionInterface::summary

File

src/Plugin/Condition/PanopolySearchCondition.php, line 118

Class

PanopolySearchCondition
Condition plugin for testing which Panopoly Search backend is being used.

Namespace

Drupal\panopoly_search\Plugin\Condition

Code

public function summary() {
  $module = $this->configuration['module'];
  $options = $this
    ->getOptions();
  if (!empty($module)) {
    if (!$this
      ->isNegated()) {
      return $this
        ->t('The "@backend" Panopoly Search backend is enabled', [
        '@backend' => $options[$module],
      ]);
    }
    else {
      return $this
        ->t('The "@backend" Panopoly Search backend is disabled', [
        '@backend' => $options[$module],
      ]);
    }
  }
  else {
    return $this
      ->t('Always evaluates to true because no backend is selected');
  }
}