class AccountId in Open Social 10.1.x
Same name and namespace in other branches
- 10.3.x modules/social_features/social_user/src/Plugin/GraphQL/DataProducer/AccountId.php \Drupal\social_user\Plugin\GraphQL\DataProducer\AccountId
- 10.0.x modules/social_features/social_user/src/Plugin/GraphQL/DataProducer/AccountId.php \Drupal\social_user\Plugin\GraphQL\DataProducer\AccountId
- 10.2.x modules/social_features/social_user/src/Plugin/GraphQL/DataProducer/AccountId.php \Drupal\social_user\Plugin\GraphQL\DataProducer\AccountId
Retrieves the user ID for an account instance.
Plugin annotation
@DataProducer(
id = "account_id",
name = @Translation("Account identifier"),
description = @Translation("Returns the account identifier."),
produces = @ContextDefinition("string",
label = @Translation("Identifier")
),
consumes = {
"account" = @ContextDefinition("any",
label = @Translation("AccountInterface instance")
)
}
)
Hierarchy
- class \Drupal\social_user\Plugin\GraphQL\DataProducer\AccountId extends \Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase
Expanded class hierarchy of AccountId
File
- modules/
social_features/ social_user/ src/ Plugin/ GraphQL/ DataProducer/ AccountId.php, line 25
Namespace
Drupal\social_user\Plugin\GraphQL\DataProducerView source
class AccountId extends DataProducerPluginBase {
/**
* Resolves the request to the requested values.
*
* @param \Drupal\Core\Session\AccountInterface $account
* The account to get the id for.
*
* @return mixed
* The user id.
*/
public function resolve(AccountInterface $account) {
return $account
->id();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccountId:: |
public | function | Resolves the request to the requested values. |