You are here

public function LocaleSourcePluginUi::getContexts in Translation Management Tool 8

Gets a list of contexts in the system.

Return value

array

1 call to LocaleSourcePluginUi::getContexts()
LocaleSourcePluginUi::overviewSearchFormPart in sources/locale/src/LocaleSourcePluginUi.php
Builds search form for entity sources overview.

File

sources/locale/src/LocaleSourcePluginUi.php, line 236

Class

LocaleSourcePluginUi
Locale source plugin UI.

Namespace

Drupal\tmgmt_locale

Code

public function getContexts() {
  $query = \Drupal::database()
    ->select('locales_source', 'ls');
  $query
    ->fields('ls', [
    'context',
    'context',
  ]);
  $query
    ->distinct();
  $query
    ->orderBy('ls.context');
  return $query
    ->execute()
    ->fetchAllKeyed();
}