You are here

public static function CampaignMonitor::getConnector in Campaign Monitor 7

Implements a singleton pattern that returns an instance of this object.

The function requires Campaign Monitor account keys to create the connection. These keys can be found at the Campaign Monitor homepage and should be entered in the administration interface. The object can then be created like this:

<?php $account = variable_get('campaignmonitor_account', array()); $cm = CampaignMonitor::getConnector($account['api_key'], $account['client_id']); ?>

Parameters

string|bool $api_key: The Campaign Monitor API key.

string|bool $client_key: The Campaign Monitor client key.

Return value

CampaignMonitor The CampaignMonitor singleton object.

16 calls to CampaignMonitor::getConnector()
campaignmonitor_admin_settings_general in includes/campaignmonitor.admin.inc
Creates the Campaign Monitor settings form.
campaignmonitor_admin_settings_general_validate in includes/campaignmonitor.admin.inc
Form validation handler. Tests if the given API keys are valid.
campaignmonitor_admin_settings_lists in includes/campaignmonitor_lists.admin.inc
Builds an overview table with basic information about the list.
campaignmonitor_admin_settings_list_create_form_validate in includes/campaignmonitor_lists.admin.inc
Validation handler for campaignmonitor_admin_settings_list_create_form().
campaignmonitor_admin_settings_list_delete_submit in includes/campaignmonitor_lists.admin.inc
Confirmation form delete callback.

... See full list

File

lib/campaignmonitor.class.inc, line 307
Implementation of the CampaignMonitor class.

Class

CampaignMonitor
Implementation of the CampaignMonitor class.

Code

public static function getConnector($api_key = FALSE, $client_key = FALSE) {
  if ($api_key && $client_key || !isset(self::$instance)) {
    $class = __CLASS__;
    self::$instance = new $class($api_key, $client_key);
  }
  return self::$instance;
}