You are here

function PMPAPIDrupal::__construct in Public Media Platform API Integration 7

Initializes a PMPAPIDrupal object.

2 calls to PMPAPIDrupal::__construct()
PMPAPIDrupalPull::__construct in pmpapi_pull/classes/PMPAPIDrupalPull.php
Initializes a PMPAPIDrupalPull object.
PMPAPIDrupalUpdate::__construct in pmpapi_update/classes/PMPAPIDrupalUpdate.php
Initializes a PMPAPIDrupalUpdate object.
2 methods override PMPAPIDrupal::__construct()
PMPAPIDrupalPull::__construct in pmpapi_pull/classes/PMPAPIDrupalPull.php
Initializes a PMPAPIDrupalPull object.
PMPAPIDrupalUpdate::__construct in pmpapi_update/classes/PMPAPIDrupalUpdate.php
Initializes a PMPAPIDrupalUpdate object.

File

classes/PMPAPIDrupal.php, line 14
Defines a class for PMP creation/transmission and retreival/parsing

Class

PMPAPIDrupal
@file

Code

function __construct($cache = TRUE) {
  $this->query = new stdClass();
  $this->base = variable_get('pmpapi_base_url');
  $this->errors = array();

  // Cache
  // cache set at __construct() trumps all
  if ($cache === FALSE) {
    $this->cache = FALSE;
  }
  elseif (variable_get('pmpapi_cache') !== NULL) {
    $this->cache = variable_get('pmpapi_cache');
  }
  else {
    $this->cache = TRUE;
  }
  $this->from_cache = FALSE;
  $this->cache_bin = variable_get('pmpapi_cache_bin', 'cache');

  // Auth
  $this
    ->sdkInclude('AuthClient');
  $this->client_id = variable_get('pmpapi_auth_client_id');
  $this->client_secret = variable_get('pmpapi_auth_client_secret');
  $this->auth_client = NULL;
  $this
    ->auth();
}