public function GoogleApiClientService::setGoogleApiClient in Google API PHP Client 8.3
Same name and namespace in other branches
- 8.4 src/Service/GoogleApiClientService.php \Drupal\google_api_client\Service\GoogleApiClientService::setGoogleApiClient()
- 8.2 src/Service/GoogleApiClientService.php \Drupal\google_api_client\Service\GoogleApiClientService::setGoogleApiClient()
Function to set the GoogleApiClient account for the service.
Parameters
\Drupal\google_api_client\GoogleApiClientInterface $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
\Drupal\Core\Entity\EntityStorageException
File
- src/
Service/ GoogleApiClientService.php, line 110
Class
- GoogleApiClientService
- Class Google API Client Service.
Namespace
Drupal\google_api_client\ServiceCode
public function setGoogleApiClient(GoogleApiClientInterface $google_api_client, \Google_Client $googleClient = NULL) {
$this->googleApiClient = $google_api_client;
// Add the client.
$this
->getClient($googleClient);
}