function user_relationship_service_service in User Relationships 6
Same name and namespace in other branches
- 5.2 plugins/user_relationship_service/user_relationship_service.module \user_relationship_service_service()
Implementation of hook_service().
File
- user_relationship_service/
user_relationship_service.module, line 23 - @author Drupal 6 port by Darren Ferguson <http://drupal.org/user/70179> @author Written by scottgifford http://drupal.org/user/245699 Link general user relationship functionalities to services module.
Code
function user_relationship_service_service() {
return array(
array(
'#method' => 'user_relationships.types',
'#callback' => 'user_relationship_service_types',
'#file' => array(
'file' => 'inc',
'module' => 'user_relationship_service',
),
'#args' => array(
array(
'#name' => 'version',
'#type' => 'int',
'#description' => t('API version to use'),
),
),
'#return' => 'array',
'#help' => t('Get a list of relationship types'),
),
array(
'#method' => 'user_relationships.mine',
'#callback' => 'user_relationship_service_mine',
'#file' => array(
'file' => 'inc',
'module' => 'user_relationship_service',
),
'#args' => array(
array(
'#name' => 'version',
'#type' => 'int',
'#description' => t('API version to use'),
),
),
'#return' => 'array',
'#help' => t('Get a list of my relationships'),
),
array(
'#method' => 'user_relationships.delete',
'#callback' => 'user_relationship_service_delete',
'#file' => array(
'file' => 'inc',
'module' => 'user_relationship_service',
),
'#args' => array(
array(
'#name' => 'version',
'#type' => 'int',
'#description' => t('API version to use'),
),
array(
'#name' => 'rid',
'#type' => 'int',
'#description' => t('Relationship ID to delete'),
),
array(
'#name' => 'reason',
'#type' => 'string',
'#description' => t('Reason for deletion (cancel, disapprove, remove)'),
),
),
'#return' => 'struct',
'#help' => t('Delete an existing or pending relationship'),
),
array(
'#method' => 'user_relationships.approve',
'#callback' => 'user_relationship_service_approve',
'#file' => array(
'file' => 'inc',
'module' => 'user_relationship_service',
),
'#args' => array(
array(
'#name' => 'version',
'#type' => 'int',
'#description' => t('API version to use'),
),
array(
'#name' => 'rid',
'#type' => 'int',
'#description' => t('Relationship ID to approve'),
),
),
'#return' => 'struct',
'#help' => t('Approve a requested relationship'),
),
array(
'#method' => 'user_relationships.request',
'#callback' => 'user_relationship_service_request',
'#file' => array(
'file' => 'inc',
'module' => 'user_relationship_service',
),
'#args' => array(
array(
'#name' => 'version',
'#type' => 'int',
'#description' => t('API version to use'),
),
array(
'#name' => 'uid',
'#type' => 'int',
'#description' => t('UID to request a relationship with'),
),
array(
'#name' => 'type',
'#type' => 'string',
'#description' => t('Name of relationship type to create'),
),
),
'#return' => 'struct',
'#help' => t('Request a relationship with another user'),
),
);
}