You are here

public function LingotekAccount::__construct in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekAccount.php \LingotekAccount::__construct()
  2. 7.2 lib/Drupal/lingotek/LingotekAccount.php \LingotekAccount::__construct()
  3. 7.4 lib/Drupal/lingotek/LingotekAccount.php \LingotekAccount::__construct()
  4. 7.5 lib/Drupal/lingotek/LingotekAccount.php \LingotekAccount::__construct()
  5. 7.6 lib/Drupal/lingotek/LingotekAccount.php \LingotekAccount::__construct()

Constructor.

Sets default values

File

lib/Drupal/lingotek/LingotekAccount.php, line 36
Defines LingotekAccount.

Class

LingotekAccount
A class representing a Lingotek Account

Code

public function __construct() {
  $this->status = self::UNKNOWN;
  $this->planType = self::UNKNOWN;

  // Load the Current Account Status from Cached local Drupal information.
  $current_status = variable_get('lingotek_account_status', NULL);
  $current_plan_type = variable_get('lingotek_account_plan_type', NULL);
  if (isset($current_status) && isset($current_plan_type)) {
    $this
      ->setStatus($current_status);
    $this
      ->setPlanType($current_plan_type);
  }
  else {

    // If the Account data isn't cached locally pull it down.
    $this
      ->getAccountStatus();
  }
}