protected function StringDatabaseStorage::checkVersion in Drupal 10
Same name and namespace in other branches
- 8 core/modules/locale/src/StringDatabaseStorage.php \Drupal\locale\StringDatabaseStorage::checkVersion()
- 9 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.
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();
}
}