Implements Drupal\locale\StringStorageInterface::delete().
Overrides StringStorageInterface::delete
public function delete($string) {
if ($keys = $this
->dbStringKeys($string)) {
$this
->dbDelete('locales_target', $keys)
->execute();
if ($string
->isSource()) {
$this
->dbDelete('locales_source', $keys)
->execute();
$this
->dbDelete('locales_location', $keys)
->execute();
$string
->setId(NULL);
}
}
else {
throw new StringStorageException(format_string('The string cannot be deleted because it lacks some key fields: @string', array(
'@string' => $string
->getString(),
)));
}
return $this;
}