function _services_uuid_resource_update in Services Client 7
Function to handle actual retrieval of the xID for the UUID
Parameters
$type:
$uuid:
Return value
int
1 string reference to '_services_uuid_resource_update'
- 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 108
Code
function _services_uuid_resource_update($type, $uuid, $id) {
switch ($type) {
case 'node':
$node = node_load($id);
$node->uuid = $uuid;
return node_save($node);
case 'user':
$account = user_load($id);
$account->uuid = $uuid;
return user_save($account, array(
'uuid' => $uuid,
));
case 'taxonomy':
case 'role':
case 'comment':
case 'file':
default:
return services_error(t('Unsupported UUID resource %type type.', array(
'%type' => $type,
)), 406);
}
}