services_resource_uri

  1. services
    1. 7.3
    2. 7 services.module
    3. 6.2 services.module
    4. 6.3
Versions
6.3 – 7.3 services_resource_uri($path)

Formats a resource uri using the formatter registered through services_set_server_info().

Parameters

array $path An array of strings containing the component parts of the path to the resource.

Return value

string Returns the formatted resource uri, or NULL if no formatter has been registered.

▾ 8 functions call services_resource_uri()

services_resource_build_index_list in ./services.module
Helper function to build a list of items satisfying the index query.
taxonomy_service_select_nodes in resources/taxonomy_resource.inc
Services interface to taxonomy_select_nodes().
_comment_resource_create in resources/comment_resource.inc
_file_resource_create in resources/file_resource.inc
Adds a new file and returns the fid.
_file_resource_create_raw in resources/file_resource.inc
Adds new files and returns the files array.
_node_resource_create in resources/node_resource.inc
Creates a new node based on submitted values.
_node_resource_update in resources/node_resource.inc
Updates a new node based on submitted values.
_user_resource_create in resources/user_resource.inc
Create a new user.

Code

./services.runtime.inc, line 241

<?php
function services_resource_uri($path) {
  $endpoint_name = services_get_server_info('endpoint');
  $endpoint = services_endpoint_load($endpoint_name);
  if (!empty($path[0]) && !empty($endpoint->resources[$path[0]]['alias'])) {
    $path[0] = $endpoint->resources[$path[0]]['alias'];
  }
  $formatter = services_get_server_info('resource_uri_formatter');
  if ($formatter) {
    return call_user_func($formatter, $path);
  }
  return NULL;
}
?>