function user_service_service in Services 6.2
Same name and namespace in other branches
- 5 services/user_service/user_service.module \user_service_service()
- 6 services/user_service/user_service.module \user_service_service()
- 7 services/user_service/user_service.module \user_service_service()
Implementation of hook_service().
File
- services/
user_service/ user_service.module, line 23 - Link general user functionalities to services module.
Code
function user_service_service() {
return array(
// user.delete
array(
'#method' => 'user.delete',
'#callback' => 'user_service_delete',
'#access callback' => 'user_service_delete_access',
'#file' => array(
'file' => 'inc',
'module' => 'user_service',
),
'#args' => array(
array(
'#name' => 'uid',
'#type' => 'int',
'#description' => t('User ID.'),
),
),
'#return' => 'struct',
'#help' => t('Delete an user.'),
),
// user.get
array(
'#method' => 'user.get',
'#callback' => 'user_service_get',
'#access callback' => 'user_service_get_access',
'#file' => array(
'file' => 'inc',
'module' => 'user_service',
),
'#args' => array(
array(
'#name' => 'uid',
'#type' => 'int',
'#description' => t('User ID.'),
),
),
'#return' => 'struct',
'#help' => t('Get all user details.'),
),
// user.login
array(
'#method' => 'user.login',
'#callback' => 'user_service_login',
'#access callback' => 'services_access_menu',
'#file' => array(
'file' => 'inc',
'module' => 'user_service',
),
'#args' => array(
array(
'#name' => 'username',
'#type' => 'string',
'#description' => t('A valid username.'),
),
array(
'#name' => 'password',
'#type' => 'string',
'#description' => t('A valid password.'),
),
),
'#return' => 'struct',
'#help' => t('Logs in a user.'),
),
// user.logout
array(
'#method' => 'user.logout',
'#callback' => 'user_service_logout',
'#access callback' => 'services_access_menu',
'#file' => array(
'file' => 'inc',
'module' => 'user_service',
),
'#args' => array(),
'#return' => 'bool',
'#help' => t('Logs out a user.'),
),
// user.save
array(
'#method' => 'user.save',
'#callback' => 'user_service_save',
'#access callback' => 'user_service_save_access',
'#file' => array(
'file' => 'inc',
'module' => 'user_service',
),
'#args' => array(
array(
'#name' => 'account',
'#type' => 'array',
'#description' => t('A user object.'),
),
),
'#return' => 'int',
'#help' => t('Save user details.'),
),
);
}