You are here

function _user_resource_retrieve in Services 6.3

Same name and namespace in other branches
  1. 7.3 resources/user_resource.inc \_user_resource_retrieve()

Get user details.

Parameters

$uid: UID of the user to be loaded.

Return value

A user object.

See also

user_load()

1 string reference to '_user_resource_retrieve'
_user_resource_definition in resources/user_resource.inc
@file This file will define the resources for dealing with the user object

File

resources/user_resource.inc, line 192
This file will define the resources for dealing with the user object

Code

function _user_resource_retrieve($uid) {
  $account = user_load($uid);
  if (empty($account)) {
    return services_error(t('There is no user with such ID.'), 404);
  }
  services_remove_user_data($account);

  // Everything went right.
  return $account;
}