Gets keys values that are in a database table.
Drupal\locale\StringInterface $string: The string object.
array Array with key fields if the string has all keys, or empty array if not.
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();
}
}