You are here

public function Lingotek::getAccountInfo in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  2. 8.2 src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  3. 4.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  4. 3.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  5. 3.1.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  6. 3.2.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  7. 3.3.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  8. 3.5.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  9. 3.6.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  10. 3.7.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()
  11. 3.8.x src/Lingotek.php \Drupal\lingotek\Lingotek::getAccountInfo()

Get the account information.

Return value

array|bool Array with account info. FALSE in case of error. The keys are user_id, username, login_id, email, and name.

Overrides LingotekInterface::getAccountInfo

File

src/Lingotek.php, line 132

Class

Lingotek
The connecting class between Drupal and Lingotek

Namespace

Drupal\lingotek

Code

public function getAccountInfo() {
  try {
    $response = $this->api
      ->getAccountInfo();
  } catch (LingotekApiException $e) {

    // TODO: log a warning
    return FALSE;
  }
  if ($response) {
    return json_decode($response
      ->getBody(), TRUE);
  }

  // TODO: log a warning
  return FALSE;
}