You are here

function ClientsConnectionEntityUIController::getOverviewEntities in Web Service Clients 7.3

Retrieves the entities for the admin overview.

Overridden to add environment substitution information to the connections.

Overrides ClientsHandlerEntityUIController::getOverviewEntities

File

includes/clients.ui.inc, line 214
Provides a controller for building an entity overview form.

Class

ClientsConnectionEntityUIController
UI controller class for connections.

Code

function getOverviewEntities($conditions) {
  $connections = parent::getOverviewEntities($conditions);

  // Determine whether any connections will substitute for others.
  $environment_name = variable_get('environment_name', NULL);
  if (isset($environment_name)) {
    foreach ($connections as $name => $connection) {

      // We only need to check substitution in one direction, since we are
      // working over all connections. So we choose the easy one: appending
      // the environment rather than removing it.
      $substitute_name = $name . '_' . $environment_name;
      if (isset($connections[$substitute_name])) {
        $connection->environment_substituted_by = $substitute_name;
        $connections[$substitute_name]->environment_substitute_for = $name;
      }
    }
  }
  return $connections;
}