protected function StringDatabaseStorage::dbStringKeys

Gets keys values that are in a database table.

Parameters

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

string $table: (optional) The table name.

Return value

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

2 calls to StringDatabaseStorage::dbStringKeys()

File

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

Class

StringDatabaseStorage
Defines the locale string class.

Namespace

Drupal\locale

Code

protected function dbStringKeys($string, $table = NULL) {
  $table = $table ? $table : $this
    ->dbStringTable($string);
  if ($table && ($schema = drupal_get_schema($table))) {
    $keys = $schema['primary key'];
    $values = $string
      ->getValues($keys);
    if (count($values) == count($keys)) {
      return $values;
    }
  }
  return NULL;
}