You are here

protected function StringDatabaseStorage::dbStringKeys in Localization update 7.2

Gets keys values that are in a database table.

Parameters

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 includes/locale/StringDatabaseStorage.php
Updates string object in the database.
StringDatabaseStorage::delete in includes/locale/StringDatabaseStorage.php
Implements StringStorageInterface::delete().

File

includes/locale/StringDatabaseStorage.php, line 232
Definition of StringDatabaseStorage.

Class

StringDatabaseStorage
Defines the locale string class.

Code

protected function dbStringKeys(StringInterface $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();
  }
}