Implements Drupal\locale\StringStorageInterface::save().
Overrides StringStorageInterface::save
public function save($string) {
if ($string
->isNew()) {
$result = $this
->dbStringInsert($string);
if ($string
->isSource() && $result) {
// Only for source strings, we set the locale identifier.
$string
->setId($result);
}
$string
->setStorage($this);
}
else {
$this
->dbStringUpdate($string);
}
// Update locations if they come with the string.
$this
->updateLocation($string);
return $this;
}