protected function StringDatabaseStorage::checkVersion

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

Parameters

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

string $version: Drupal version to check against.

2 calls to StringDatabaseStorage::checkVersion()
StringDatabaseStorage::findTranslation in drupal/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
Implements Drupal\locale\StringStorageInterface::findTranslation().
StringDatabaseStorage::updateLocation in drupal/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
Update locations for string.

File

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

Class

StringDatabaseStorage
Defines the locale string class.

Namespace

Drupal\locale

Code

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