You are here

public function OptionalContextCondition::evaluate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php \Drupal\condition_test\Plugin\Condition\OptionalContextCondition::evaluate()

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

core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php, line 31
Contains \Drupal\condition_test\Plugin\Condition\OptionalContextCondition.

Class

OptionalContextCondition
Provides a condition with an optional node context.

Namespace

Drupal\condition_test\Plugin\Condition

Code

public function evaluate() {

  // Grant access if no context value is given.
  return !$this
    ->getContextValue('node');
}