You are here

function hook_services_historical_info in Services Tools 7.3

Define historical services provided by the module.

Return value

An associative array whose keys will be used for reference and whose values contain the historical descriptions. Each historical description is itself an associative array, with the following key-value pairs:

  • 'endpoint': (required) The name of the endpoint to which the historical

endpoints are related.

  • 'version': (required) The current version of the API (ex. 1.7).
  • 'suffix': (optional) A numerical suffix to append to

hook_services_historical_endpoint() and to each hook_services_historical_update_N() before the N. The suffix will not effect the version number used for the update hooks (ie. N will include the suffix). The suffix is useful if an API with two or more 'levels' has more then one major version and those are defined separately. For example, an API with the following versions: 1.0, 1.1, 1.2, 2.0, 2.1 could use a suffix of 1 and 2 to define each historical set separately, but the 'version' in each should be the same. By defining major API versions separately they can be placed in separate modules and/or have different base endpoints. Defaults to blank.

  • 'levels': (optional) The number of levels in the API version, must be

>= 1. For example, 2 levels would mean version numbers like: 1.0, 1.1. Defaults to 2.

  • 'format': (optional) The version number format to use in labels and the

URL, see sprintf() for documentation. The format is generated if not defined based on the number of levels. Defaults to %d.%d.

  • 'module': (optional) The module providing the hooks. Defaults to the

module for which this hook is written.

1 function implements hook_services_historical_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

services_tools_example_historical_services_historical_info in services_historical/services_tools_example/historical/services_tools_example_historical.module
Implements hook_services_historical_info().
1 invocation of hook_services_historical_info()
services_historical_info in services_historical/services_historical.module
Get historical services information.

File

services_historical/services_historical.api.php, line 39
Document services_historical hooks.

Code

function hook_services_historical_info() {

  // Simple example where the entire historical API is defined once.
  return array(
    'my_historical_api' => array(
      'endpoint' => 'my_api',
      'version' => '1.7',
    ),
  );

  // Complex example where the historical API is split for each major API
  // version.
  return array(
    'my_historical_api_1' => array(
      'endpoint' => 'my_api',
      'version' => '2.0',
      'suffix' => 1,
    ),
    'my_historical_api_2' => array(
      'endpoint' => 'my_api',
      'version' => '2.0',
      'suffix' => 2,
    ),
  );
}