public function GoogleApiServiceClientService::setGoogleApiClient in Google API PHP Client 8.3
Same name and namespace in other branches
- 8.4 src/Service/GoogleApiServiceClientService.php \Drupal\google_api_client\Service\GoogleApiServiceClientService::setGoogleApiClient()
Function to set the GoogleApiClient account for the service.
Parameters
\Drupal\google_api_client\GoogleApiServiceClientInterface $google_api_client: Pass completely loaded GoogleApiClient object.
\Google_Client|null $googleClient: Optionally parameter for developers who want to set initial google client object.
Throws
\Google_Exception
File
- src/
Service/ GoogleApiServiceClientService.php, line 99
Class
- GoogleApiServiceClientService
- Class Google API Client Service.
Namespace
Drupal\google_api_client\ServiceCode
public function setGoogleApiClient(GoogleApiServiceClientInterface $google_api_client, \Google_Client $googleClient = NULL) {
$this->googleApiServiceClient = $google_api_client;
// Add the client.
$this
->getClient($googleClient);
}