function StringDatabaseStorage::checkVersion
Same name in other branches
- 8.9.x core/modules/locale/src/StringDatabaseStorage.php \Drupal\locale\StringDatabaseStorage::checkVersion()
- 10 core/modules/locale/src/StringDatabaseStorage.php \Drupal\locale\StringDatabaseStorage::checkVersion()
- 11.x core/modules/locale/src/StringDatabaseStorage.php \Drupal\locale\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 core/
modules/ locale/ src/ StringDatabaseStorage.php - Loads a string translation object, fast query.
- StringDatabaseStorage::updateLocation in core/
modules/ locale/ src/ StringDatabaseStorage.php - Update locations for string.
File
-
core/
modules/ locale/ src/ StringDatabaseStorage.php, line 175
Class
- StringDatabaseStorage
- Defines a class to store localized strings in the database.
Namespace
Drupal\localeCode
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([
'version' => $version,
])
->execute();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.