StringStorageException example


  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('The string cannot be deleted because it lacks some key fields: ' . $string->getString());
    }
    return $this;
  }

  /** * {@inheritdoc} */
  public function deleteStrings($conditions) {
    $lids = $this->dbStringSelect($conditions['fields' => ['lid']])->execute()->fetchCol();
    if ($lids) {
      $this->dbDelete('locales_target', ['lid' => $lids])->execute();
      
return isset($locations[$type]) ? !empty($locations[$type][$name]) : FALSE;
  }

  /** * {@inheritdoc} */
  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;
  }

  /** * {@inheritdoc} */
  public function delete() {
    if (!$this->isNew()) {
      if ($storage = $this->getStorage()) {
        $storage->delete($this);
      }
Home | Imprint | This part of the site doesn't use cookies.