public function getToken($type, $allowCache=true) {
        $tokenName = $type . 'token';
        if (!empty($this->tokencache[$tokenName]) && $allowCache) {
            return $this->tokencache[$tokenName];
        }
        $tokens = $this->getTokens(array($type));
        return $tokens[$tokenName];
    }
public function getToken($type, $allowCache=true) {
        $tokenName = $type . 'token';
        if (!empty($this->tokencache[$tokenName]) && $allowCache) {
            return $this->tokencache[$tokenName];
        }
        $tokens = $this->getTokens(array($type));
        return $tokens[$tokenName];
    }
public function getToken ( $ type , $ allowCache = true ) { $ tokenName = $ type . 'token' ; if ( ! empty ( $ this -> tokencache [ $ tokenName ] ) && $ allowCache ) { return $ this -> tokencache [ $ tokenName ] ; } $ tokens = $ this -> getTokens ( array ( $ type ) ) ; return $ tokens [ $ tokenName ] ; }
Get a single token from API or from cache if one was already fetched.

@param string $type
@param boolean $allowCache
@return type
Get a single token from API or from cache if one was already fetched .