public function OptionalContextCondition::evaluate in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php \Drupal\condition_test\Plugin\Condition\OptionalContextCondition::evaluate()
- 9 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 26
Class
- OptionalContextCondition
- Provides a condition with an optional node context.
Namespace
Drupal\condition_test\Plugin\ConditionCode
public function evaluate() {
// Grant access if no context value is given.
return !$this
->getContextValue('node');
}