protected function StringDatabaseStorage::dbStringKeys

Gets keys values that are in a database table.

Parameters

Drupal\locale\StringInterface $string: The string object.

Return value

array Array with key fields if the string has all keys, or empty array if not.

2 calls to StringDatabaseStorage::dbStringKeys()
StringDatabaseStorage::dbStringUpdate in drupal/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
Updates string object in the database.
StringDatabaseStorage::delete in drupal/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
Implements Drupal\locale\StringStorageInterface::delete().

File

drupal/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php, line 294
Definition of Drupal\locale\StringDatabaseStorage.

Class

StringDatabaseStorage
Defines the locale string class.

Namespace

Drupal\locale

Code

protected function dbStringKeys($string) {
  if ($string
    ->isSource()) {
    $keys = array(
      'lid',
    );
  }
  elseif ($string
    ->isTranslation()) {
    $keys = array(
      'lid',
      'language',
    );
  }
  if (!empty($keys) && ($values = $string
    ->getValues($keys)) && count($keys) == count($values)) {
    return $values;
  }
  else {
    return array();
  }
}