StringBase::save

public StringBase::save()

Saves string object to storage.

Return value

$this

Throws

\Drupal\locale\StringStorageException In case of failures, an exception is thrown.

Overrides StringInterface::save

File

core/modules/locale/src/StringBase.php, line 181

Class

StringBase
Defines the locale string base class.

Namespace

Drupal\locale

Code

public function save() {
  if ($storage = $this->getStorage()) {
    $storage->save($this);
  }
  else {
    throw new StringStorageException('The string cannot be saved because its not bound to a storage: ' . $this->getString());
  }
  return $this;
}
doc_Drupal
2016-10-29 09:45:02
Comments
Leave a Comment

Please login to continue.