You are here

function services_resource_api_update_3002 in Services 6.3

Same name and namespace in other branches
  1. 7.3 includes/services.resource_update.inc \services_resource_api_update_3002()

Updates resource definitions to the 3002 version with normalized definitions for the CRUD operations. The CRUD operations will now be namespaced just like relationships, targeted_actions and actions.

Parameters

array $resources:

Return value

void

File

./services.resource_update.inc, line 11

Code

function services_resource_api_update_3002(&$resources) {
  static $operations = array(
    'create',
    'retrieve',
    'update',
    'delete',
    'index',
  );
  foreach ($resources as $name => &$resource) {
    foreach ($operations as $key) {
      if (!empty($resource[$key])) {
        $resource['operations'][$key] = $resource[$key];
        unset($resource[$key]);
      }
    }
  }
}