You are here

function _google_api_client_google_services_names in Google API PHP Client 8.2

Same name and namespace in other branches
  1. 8.4 google_api_client.module \_google_api_client_google_services_names()
  2. 8.3 google_api_client.module \_google_api_client_google_services_names()
4 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.
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 77
Google Auth Api for drupal.

Code

function _google_api_client_google_services_names($services = FALSE) {
  $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 (!$services) {
    asort($names);
    return $names;
  }
  else {
    $service_names = array();
    if (!is_array($services)) {
      $services = explode(",", $services);
    }
    foreach ($services as $service) {
      $service_names[trim($service)] = $names[$service];
    }
    return $service_names;
  }
}