public function ConditionTestDualUser::evaluate in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php \Drupal\condition_test\Plugin\Condition\ConditionTestDualUser::evaluate()
- 9 core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php \Drupal\condition_test\Plugin\Condition\ConditionTestDualUser::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/ ConditionTestDualUser.php, line 24
Class
- ConditionTestDualUser
- Provides a condition that requires two users.
Namespace
Drupal\condition_test\Plugin\ConditionCode
public function evaluate() {
$user1 = $this
->getContextValue('user1');
$user2 = $this
->getContextValue('user2');
return $user1
->id() === $user2
->id();
}