You are here

class clients_connection_broken in Web Service Clients 6.2

Same name and namespace in other branches
  1. 7.2 clients.inc \clients_connection_broken

Connection class for broken connections.

Hierarchy

Expanded class hierarchy of clients_connection_broken

1 string reference to 'clients_connection_broken'
clients_connection_unpack_object in ./clients.module
CTools object factory: unpacks the data from CTools into the right class.

File

./clients.inc, line 167
Contains basic classes for client connections.

View source
class clients_connection_broken extends clients_connection_base {

  /**
   * Constructor method for broken connections.
   *
   * This expects the originator to have set a readable message in
   * $object->broken_message.
   *
   * @param $object
   *  An object of class stdClass returned from CTools.
   */
  function __construct($object) {

    // Call the base class to set the connection properties.
    $object = parent::__construct($object);

    // Add some output for the view connection page.
    $this->configuration['WARNING'] = t("This connection is broken.");
    $this->configuration['broken message'] = $object->broken_message;
    $connection_path = 'admin/build/clients/connections/' . $this->name;
    if ($_GET['q'] == $connection_path) {
      $message = t('This connection is broken.');
    }
    else {
      $message = t('A connection is broken. See its <a href="@url">view page</a> for further details.', array(
        '@url' => url($connection_path),
      ));
    }
    drupal_set_message($message, 'warning');
  }

  /**
   * Fail to call a remote method with an array of parameters.
   *
   * This is provided so attempting to call a method on a bad connection
   * throws an exception.
   *
   * @return
   *  Nothing.
   *
   * @throws Exception with the error the handler set on creation.
   */
  function callMethodArray($method, $method_params = array()) {
    throw new Exception($this->configuration['broken message']);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
clients_connection_base::$cid public property The connection id. Only set if this is stored in the database.
clients_connection_base::$configuration public property An array of further configuration options.
clients_connection_base::$endpoint public property The URL this connection connects to.
clients_connection_base::$name public property The machine name of the connection.
clients_connection_base::callMethod function Call a remote method.
clients_connection_base::connectionSettingsForm function Extra form elements specific to a class's edit form. 2
clients_connection_base::connectionSettingsForm_submit static function Submit handler for saving/updating connections of this class. 2
clients_connection_base::formatEndpoint function Format the connection's endpoint as a link. 2
clients_connection_base::getTestOperations function Provide buttons for the connection testing page. 1
clients_connection_broken::callMethodArray function Fail to call a remote method with an array of parameters. Overrides clients_connection_base::callMethodArray
clients_connection_broken::__construct function Constructor method for broken connections. Overrides clients_connection_base::__construct