You are here

function user_service_get in Services 6.2

Same name and namespace in other branches
  1. 6 services/user_service/user_service.inc \user_service_get()
  2. 7 services/user_service/user_service.inc \user_service_get()

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_service_get'
user_service_service in services/user_service/user_service.module
Implementation of hook_service().

File

services/user_service/user_service.inc, line 50
Link general user functionalities to services module.

Code

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

  // Everything went right.
  return $account;
}