You are here

function services_get_resources in Services 7.3

Same name and namespace in other branches
  1. 6.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.

5 calls to services_get_resources()
ServicesRESTServerFactory::getResources in servers/rest_server/includes/ServicesRESTServerFactory.inc
services_controllers_list in ./services.module
Returns all the controller names for a endpoint.
services_controller_get in ./services.module
Returns the requested controller.
services_get_resources_apply_settings in ./services.module
Load the resources of the endpoint.
xmlrpc_server_xmlrpc in servers/xmlrpc_server/xmlrpc_server.module
Return an array of all defined services methods and callbacks.

File

./services.module, line 497
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('inc', 'services', 'includes/services.resource_build');
    $resources = _services_build_resources($endpoint_name);
    cache_set($cache_key, $resources);
  }
  return $resources;
}