You are here

public function PanopolySearchCondition::evaluate in Panopoly 8.2

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

bool TRUE if the condition has been met, FALSE otherwise.

Overrides ConditionInterface::evaluate

File

modules/panopoly/panopoly_search/src/Plugin/Condition/PanopolySearchCondition.php, line 106

Class

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

Namespace

Drupal\panopoly_search\Plugin\Condition

Code

public function evaluate() {
  $module = $this->configuration['module'];
  if (empty($module)) {

    // Make sure the value is always TRUE, even if it's going to be negated.
    return $this
      ->isNegated() ? FALSE : TRUE;
  }
  return $this->moduleHandler
    ->moduleExists($module);
}