You are here

public static function InstapageCmsPluginHelper::getTokens in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/InstapageCmsPluginHelper.php \InstapageCmsPluginHelper::getTokens()

Gets API tokens stored in the DB.

Return value

array Stored tokens.

1 call to InstapageCmsPluginHelper::getTokens()
InstapageCmsPluginSubaccountModel::getAllTokens in core/models/InstapageCmsPluginSubaccountModel.php
Gets all the tokens - stored in plugin's settings and bound to currently used app user account.

File

core/InstapageCmsPluginHelper.php, line 193

Class

InstapageCmsPluginHelper
Helper containing commonly used static functions.

Code

public static function getTokens() {
  $config = self::getOptions(true);
  $tokens = array();
  if (!isset($config->tokens) || !is_array($config->tokens)) {
    return array();
  }
  foreach ($config->tokens as $token) {
    $tokens[] = $token->value;
  }
  return $tokens;
}