public function StringBase::delete

Implements Drupal\locale\LocaleString::delete().

Overrides StringInterface::delete

1 call to StringBase::delete()
TranslationString::delete in drupal/core/modules/locale/lib/Drupal/locale/TranslationString.php
Implements Drupal\locale\StringInterface::delete().
1 method overrides StringBase::delete()
TranslationString::delete in drupal/core/modules/locale/lib/Drupal/locale/TranslationString.php
Implements Drupal\locale\StringInterface::delete().

File

drupal/core/modules/locale/lib/Drupal/locale/StringBase.php, line 201
Definition of Drupal\locale\StringBase.

Class

StringBase
Defines the locale string base class.

Namespace

Drupal\locale

Code

public function delete() {
  if (!$this
    ->isNew()) {
    if ($storage = $this
      ->getStorage()) {
      $storage
        ->delete($this);
    }
    else {
      throw new StringStorageException(format_string('The string cannot be deleted because its not bound to a storage: @string', array(
        '@string' => $string
          ->getString(),
      )));
    }
  }
  return $this;
}