You are here

protected function StringDatabaseStorage::checkVersion in Localization update 7.2

Checks whether the string version matches a given version, fix it if not.

Parameters

StringInterface $string: The string object.

string $version: Drupal version to check against.

1 call to StringDatabaseStorage::checkVersion()
StringDatabaseStorage::findTranslation in includes/locale/StringDatabaseStorage.php
Implements StringStorageInterface::findTranslation().

File

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

Class

StringDatabaseStorage
Defines the locale string class.

Code

protected function checkVersion(StringInterface $string, $version) {
  if ($string
    ->getId() && $string
    ->getVersion() != $version) {
    $string
      ->setVersion($version);
    db_update('locales_source', $this->options)
      ->condition('lid', $string
      ->getId())
      ->fields(array(
      'version' => $version,
    ))
      ->execute();
  }
}