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

1
2
3
4
5
6
7
8
9
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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.