function _services_uuid_resource_retrieve in Services Client 7
Same name and namespace in other branches
- 7.2 services_uuid/services_uuid.module \_services_uuid_resource_retrieve()
Function to handle actual retrieval of the xID for the UUID
Parameters
$type:
$uuid:
Return value
int
1 call to _services_uuid_resource_retrieve()
- _services_uuid_resource_access in services_uuid/
services_uuid.module - Access callback to handle permissions for retrieving UUIDs
1 string reference to '_services_uuid_resource_retrieve'
- services_uuid_services_resources in services_uuid/
services_uuid.module - Implementation of hook_services_resources() Defines the UUID resource fo the services module
File
- services_uuid/
services_uuid.module, line 76
Code
function _services_uuid_resource_retrieve($type, $uuid) {
switch ($type) {
case 'node':
$nid = uuid_node_find($uuid);
return $nid;
case 'user':
$uid = uuid_user_find($uuid);
return $uid;
case 'taxonomy':
$tid = uuid_taxonomy_term_find($uuid);
return $tid;
case 'role':
$rid = uuid_role_find($uuid);
return $rid;
case 'comment':
$cid = uuid_comment_find($uuid);
return $cid;
case 'file':
$fid = uuid_file_find($uuid);
return $fid;
default:
return services_error(t('Unsupported UUID resource %type type.', array(
'%type' => $type,
)), 406);
}
}