function _google_api_client_google_services_names in Google API PHP Client 8.3
Same name and namespace in other branches
- 8.4 google_api_client.module \_google_api_client_google_services_names()
- 8.2 google_api_client.module \_google_api_client_google_services_names()
Function returns service names.
Parameters
array|string $services: Pass array of services or comma separated services.
Return value
array|mixed|null Returns array of names with service machine name as index.
5 calls to _google_api_client_google_services_names()
- GoogleApiClientListBuilder::buildRow in src/
Entity/ Controller/ GoogleApiClientListBuilder.php - Builds a row for an entity in the entity listing.
- GoogleApiServiceClientForm::form in src/
Form/ GoogleApiServiceClientForm.php - Gets the actual form array to be built.
- google_api_client_google_scopes_names in ./
google_api_client.module - google_api_client_google_services_names in ./
google_api_client.module - Returns a array services api names.
- google_api_client_update_8001 in ./
google_api_client.install - Create Entity Type for Google Api Client.
File
- ./
google_api_client.module, line 86 - Google Api Client for drupal.
Code
function _google_api_client_google_services_names($services = []) {
$names = \Drupal::config('google_api_client.google_api_services')
->get('google_api_client_google_api_services');
if (empty($names)) {
_google_api_client_read_scope_info();
$names = \Drupal::config('google_api_client.google_api_services')
->get('google_api_client_google_api_services');
}
if (empty($services)) {
asort($names);
return $names;
}
else {
$service_names = [];
if (!is_array($services)) {
$services = explode(",", $services);
}
foreach ($services as $service) {
$service_names[trim($service)] = $names[$service];
}
return $service_names;
}
}