You are here

public function UserStatus::resolve in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_user/src/Plugin/GraphQL/DataProducer/UserStatus.php \Drupal\social_user\Plugin\GraphQL\DataProducer\UserStatus::resolve()
  2. 10.0.x modules/social_features/social_user/src/Plugin/GraphQL/DataProducer/UserStatus.php \Drupal\social_user\Plugin\GraphQL\DataProducer\UserStatus::resolve()
  3. 10.2.x modules/social_features/social_user/src/Plugin/GraphQL/DataProducer/UserStatus.php \Drupal\social_user\Plugin\GraphQL\DataProducer\UserStatus::resolve()

Resolves the value for this data producer.

Parameters

\Drupal\user\UserInterface $user: The user to get the status from.

Return value

string The status of the user ("ACTIVE" or "BLOCKED").

File

modules/social_features/social_user/src/Plugin/GraphQL/DataProducer/UserStatus.php, line 37

Class

UserStatus
Returns the status for a user.

Namespace

Drupal\social_user\Plugin\GraphQL\DataProducer

Code

public function resolve(UserInterface $user) {
  return $user
    ->isActive() ? "ACTIVE" : "BLOCKED";
}