You are here

protected function StringDatabaseStorage::dbFieldTable in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/locale/src/StringDatabaseStorage.php \Drupal\locale\StringDatabaseStorage::dbFieldTable()

Gets table alias for field.

Parameters

string $field: One of the field names of the locales_source, locates_location, locales_target tables to find the table alias for.

Return value

string One of the following values:

  • 's' for "source", "context", "version" (locales_source table fields).
  • 'l' for "type", "name" (locales_location table fields)
  • 't' for "language", "translation", "customized" (locales_target table fields)
1 call to StringDatabaseStorage::dbFieldTable()
StringDatabaseStorage::dbStringSelect in core/modules/locale/src/StringDatabaseStorage.php
Builds a SELECT query with multiple conditions and fields.

File

core/modules/locale/src/StringDatabaseStorage.php, line 253

Class

StringDatabaseStorage
Defines a class to store localized strings in the database.

Namespace

Drupal\locale

Code

protected function dbFieldTable($field) {
  if (in_array($field, [
    'language',
    'translation',
    'customized',
  ])) {
    return 't';
  }
  elseif (in_array($field, [
    'type',
    'name',
  ])) {
    return 'l';
  }
  else {
    return 's';
  }
}