function ConditionTestDualUser::evaluate

Same name in other branches
  1. 8.9.x core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php \Drupal\condition_test\Plugin\Condition\ConditionTestDualUser::evaluate()
  2. 10 core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php \Drupal\condition_test\Plugin\Condition\ConditionTestDualUser::evaluate()
  3. 11.x core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php \Drupal\condition_test\Plugin\Condition\ConditionTestDualUser::evaluate()

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\Condition

Code

public function evaluate() {
    $user1 = $this->getContextValue('user1');
    $user2 = $this->getContextValue('user2');
    return $user1->id() === $user2->id();
}

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