function favorites_service_service in MediaFront 6
Same name and namespace in other branches
- 6.2 services/favorites_service/favorites_service.module \favorites_service_service()
Implementation of hook_service()
File
- services/
favorites_service/ favorites_service.module, line 22
Code
function favorites_service_service() {
return array(
// vote.get
array(
'#method' => 'favorites.getFavorites',
'#callback' => 'favorites_service_get_favorites',
'#access arguments' => array(
'access content',
),
'#key' => FALSE,
'#args' => array(
array(
'#name' => 'uid',
'#type' => 'int',
'#description' => t('The user ID for which you are retrieving the favorites for.'),
),
array(
'#name' => 'type',
'#type' => 'text',
'#description' => t('The node type of the favorites to get.'),
),
array(
'#name' => 'limit',
'#type' => 'int',
'#description' => t('The limit of the amount of items to get.'),
),
),
'#return' => 'int',
'#help' => t('Returns the favorite nodes of a user.'),
),
// favorite.set
array(
'#method' => 'favorites.setFavorite',
'#callback' => 'favorites_service_set_favorite',
'#access arguments' => array(
'allow remote favorites',
),
'#args' => array(
array(
'#name' => 'nid',
'#type' => 'int',
'#description' => t('The node ID which you would like to set as your favorite.'),
),
),
'#return' => 'int',
'#help' => t('Submit a new favorite.'),
),
// favorite.delete
array(
'#method' => 'favorites.deleteFavorite',
'#callback' => 'favorites_service_delete_favorite',
'#access arguments' => array(
'allow remote favorites',
),
'#args' => array(
array(
'#name' => 'nid',
'#type' => 'int',
'#description' => t('The node ID which you would like to delete as your favorite.'),
),
),
'#return' => 'int',
'#help' => t('Delete a favorite.'),
),
);
}