You are here

function clients_get_connection_types in Web Service Clients 7.3

Same name and namespace in other branches
  1. 6.2 clients.module \clients_get_connection_types()
  2. 7 clients.module \clients_get_connection_types()
  3. 7.2 clients.module \clients_get_connection_types()

Get a list of all connection types.

Parameters

$type: (Optional) The name of a single type to return a definition for. If omitted, all definitions are returned.

Return value

An array of connection type definitions, keyed by machine name.

See also

hook_clients_connection_type_info()

2 calls to clients_get_connection_types()
ClientsHandlerEntityController::getClass in includes/clients.controller.inc
Helper to get the class to create for an entity.
clients_connection_test_form in includes/clients.connection.admin.inc
Form to test a connection.
1 string reference to 'clients_get_connection_types'
clients_entity_info in ./clients.module
Implements hook_entity_info().

File

./clients.module, line 255
Clients module provides a UI, storage, and an API for handling connections to remote webservices, including those provided by Services module on other Drupal sites.

Code

function clients_get_connection_types($type = NULL) {
  $connection_types =& drupal_static(__FUNCTION__);
  if (!isset($connection_types)) {
    if ($cache = cache_get('clients_connection_type_info')) {
      $connection_types = $cache->data;
    }
    else {

      // Invoke hook_clients_connection_type_info().
      $connection_types = module_invoke_all('clients_connection_type_info');
      drupal_alter('clients_connection_type_info', $connection_types);
      cache_set('clients_connection_type_info', $connection_types);
    }
  }
  if (isset($type)) {
    if (isset($connection_types[$type])) {
      return $connection_types[$type];
    }
  }
  else {
    return $connection_types;
  }
}