Checks whether the string version matches a given version, fix it if not.
Drupal\locale\StringInterface $string: The string object.
string $version: Drupal version to check against.
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();
}
}