You are here

public function LingotekApi::listProjects in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
  2. 7.3 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
  3. 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
  4. 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()
  5. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::listProjects()

Gets available Lingotek projects.

Return value

array An array of available projects with project IDs as keys, project labels as values.

File

lib/Drupal/lingotek/LingotekApi.php, line 693
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function listProjects() {
  $projects = array();
  if ($projects_raw = $this
    ->request('listProjects')) {
    foreach ($projects_raw->projects as $project) {
      $projects[$project->id] = $project->name;
    }
  }
  return $projects;
}