You are here

function userpoints_service_get in User Points 7

Same name and namespace in other branches
  1. 5.3 userpoints_service.module \userpoints_service_get()
  2. 6 userpoints_service.module \userpoints_service_get()
  3. 7.2 userpoints_service/userpoints_service.inc \userpoints_service_get()

Get the number of points of a given user.

1 string reference to 'userpoints_service_get'
userpoints_service_services_resources in ./userpoints_service.module
Implementation of hook_services_resources().

File

./userpoints_service.inc, line 55
Callbacks and access callbacks for userpoints services integration.

Code

function userpoints_service_get($uid, $tid = NULL, $type = 'current') {
  if (!$uid) {
    return services_error(t('User ID parameter is required.'));
  }
  if ($tid === NULL) {
    $tid = userpoints_get_default_tid();
  }
  if ($type == 'max') {
    return userpoints_get_max_points($uid, $tid);
  }
  return userpoints_get_current_points($uid, $tid);
}