You are here

private function CampaignMonitor::__construct in Campaign Monitor 7

Private class constructor.

Prevents creation of this class directly. Use the static function CampaignMonitor::GetConnector().

Parameters

string|bool $api_key: (optional) The api key.

string|bool $client_id: (optional) The client ID.

File

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

Class

CampaignMonitor
Implementation of the CampaignMonitor class.

Code

private function __construct($api_key = FALSE, $client_id = FALSE) {

  // Get account information.
  $account = variable_get('campaignmonitor_account', []);

  // Get API key/client ID if they are defined.
  $this->apiKey = $api_key ? $api_key : (isset($account['api_key']) ? $account['api_key'] : FALSE);
  $this->clientId = $client_id ? $client_id : (isset($account['client_id']) ? $account['client_id'] : FALSE);

  // Trying to find the Campaign Monitor library.
  $this
    ->getLibraryPath();

  // Enable logging.
  $setting = variable_get('campaignmonitor_general', []);
  if (isset($setting['logging'])) {
    $this->logErrors = $setting['logging'];
  }
}