You are here

function clients_resource_load_all in Web Service Clients 7.3

Load all resources.

Parameters

$type: (optional) Specify a single type to include. If omitted, all are returned.

Return value

An array of connection objects, keyed by name.

1 call to clients_resource_load_all()
clients_resource_remote_views_block_block_info in resources/clients_resource_remote_views_block/clients_resource_remote_views_block.module
Implements hook_block_info().

File

./clients.module, line 87
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_resource_load_all($type = NULL) {
  $resources = entity_load_multiple_by_name('clients_resource', FALSE);
  if (isset($type)) {
    $return = array();
    foreach ($resources as $name => $resource) {
      if ($resource->type == $type) {
        $return[$name] = $resource;
      }
    }
  }
  else {
    $return = $resources;
  }

  // We generally want resources ordered by machine name.
  ksort($return);
  return $return;
}