public function getClient($accessToken) {
        $client = new Google_Client();
        $client->setApplicationName($this->applicationName);
        $client->setAccessType('offline');

        $client->setAccessToken($accessToken);

        // Refresh the token if it's expired.
        if ($client->isAccessTokenExpired()) {
            $client->setAuthConfigFile(Yii::getAlias($this->clientSecretPath));
            $client->refreshToken($client->getRefreshToken());
            $this->saveAccessToken($client->getAccessToken());
        }
        return $client;
    }
public function getClient($accessToken) {
        $client = new Google_Client();
        $client->setApplicationName($this->applicationName);
        $client->setAccessType('offline');

        $client->setAccessToken($accessToken);

        // Refresh the token if it's expired.
        if ($client->isAccessTokenExpired()) {
            $client->setAuthConfigFile(Yii::getAlias($this->clientSecretPath));
            $client->refreshToken($client->getRefreshToken());
            $this->saveAccessToken($client->getAccessToken());
        }
        return $client;
    }
public function getClient ( $ accessToken ) { $ client = new Google_Client ( ) ; $ client -> setApplicationName ( $ this -> applicationName ) ; $ client -> setAccessType ( 'offline' ) ; $ client -> setAccessToken ( $ accessToken ) ; // Refresh the token if it's expired. if ( $ client -> isAccessTokenExpired ( ) ) { $ client -> setAuthConfigFile ( Yii :: getAlias ( $ this -> clientSecretPath ) ) ; $ client -> refreshToken ( $ client -> getRefreshToken ( ) ) ; $ this -> saveAccessToken ( $ client -> getAccessToken ( ) ) ; } return $ client ; }
Returns an authorized API client.

@param $accessToken string the access token
@return Google_Client the authorized client object
Returns an authorized API client .