You are here

function countries_api_service_service in Country codes API 6

Same name and namespace in other branches
  1. 5 contrib/countries_api_service/countries_api_service.module \countries_api_service_service()

Implementation of hook_service().

File

contrib/countries_api_service/countries_api_service.module, line 37
The module which exposes services related to countries_api.

Code

function countries_api_service_service() {
  return array(
    array(
      '#method' => 'countries_api.get_options_array',
      '#callback' => 'countries_api_service_get_options_array',
      '#key' => FALSE,
      '#args' => array(
        array(
          '#name' => 'first element value',
          '#type' => 'string',
          '#description' => t("The value of the first element in the array (defaults to '')"),
          '#optional' => TRUE,
        ),
        array(
          '#name' => 'first element label',
          '#type' => 'string',
          '#description' => t("The label of the first value in the array (defaults to 'Please Choose')"),
          '#optional' => TRUE,
        ),
      ),
      '#return' => 'array',
      '#help' => t('Returns an associative array in $country["iso2"] => $country["printable_name"] format.'),
    ),
  );
}