function ConditionManager::execute

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Condition/ConditionManager.php \Drupal\Core\Condition\ConditionManager::execute()
  2. 10 core/lib/Drupal/Core/Condition/ConditionManager.php \Drupal\Core\Condition\ConditionManager::execute()
  3. 11.x core/lib/Drupal/Core/Condition/ConditionManager.php \Drupal\Core\Condition\ConditionManager::execute()

Overrides ExecutableManagerInterface::execute

File

core/lib/Drupal/Core/Condition/ConditionManager.php, line 75

Class

ConditionManager
A plugin manager for condition plugins.

Namespace

Drupal\Core\Condition

Code

public function execute(ExecutableInterface $condition) {
    if ($condition instanceof ConditionInterface) {
        $result = $condition->evaluate();
        return $condition->isNegated() ? !$result : $result;
    }
    throw new ExecutableException("This manager object can only execute condition plugins");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.