You are here

function services_get_resources in Services 6.3

Same name and namespace in other branches
  1. 7.3 services.module \services_get_resources()

Gets all resource definitions.

Parameters

string $endpoint_name: Optional. The endpoint endpoint that's being used.

Return value

array An array containing all resources.

4 calls to services_get_resources()
RESTServer::handle in servers/rest_server/includes/RESTServer.inc
Handles the call to the REST server
services_controllers_list in ./services.module
Returns all the controller names for a endpoint.
services_controller_get in ./services.module
Returns the requested controller.
xmlrpc_server_xmlrpc in servers/xmlrpc_server/xmlrpc_server.module
Return an array of all defined services methods and callbacks.

File

./services.module, line 276
Provides a generic but powerful API for web services.

Code

function services_get_resources($endpoint_name = '') {
  $cache_key = 'services:' . $endpoint_name . ':resources';
  $resources = array();
  if (($cache = cache_get($cache_key)) && isset($cache->data)) {
    $resources = $cache->data;
  }
  else {
    module_load_include('resource_build.inc', 'services');
    $resources = _services_build_resources($endpoint_name);
    cache_set($cache_key, $resources);
  }
  return $resources;
}