StringDatabaseStorage::checkVersion

protected StringDatabaseStorage::checkVersion($string, $version)

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.

File

core/modules/locale/src/StringDatabaseStorage.php, line 174

Class

StringDatabaseStorage
Defines a class to store localized strings in the database.

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();
  }
}
doc_Drupal
2016-10-29 09:45:05
Comments
Leave a Comment

Please login to continue.