You are here

public function StringDatabaseStorage::save in Localization update 7.2

Implements StringStorageInterface::save().

Overrides StringStorageInterface::save

File

includes/locale/StringDatabaseStorage.php, line 94
Definition of StringDatabaseStorage.

Class

StringDatabaseStorage
Defines the locale string class.

Code

public function save(\StringInterface $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);
  }
  return $this;
}