Esempio n. 1
0
 /**
  * Löscht Artikel oder verschiebt sie in Papierkorb
  * @param array $ids
  * @return bool
  */
 public function deleteArticles(array $ids)
 {
     if (!count($ids)) {
         return false;
     }
     $where = 'id IN (' . implode(', ', $ids) . ')';
     if ($this->config->articles_trash) {
         $res = $this->dbcon->update($this->table, array('deleted', 'pinned'), array(1, 0), $where);
     } else {
         $res = $this->dbcon->delete($this->table, $where);
     }
     if ($res && !$this->config->articles_trash) {
         $commentList = new \fpcm\model\comments\commentList();
         $commentList->deleteCommentsByArticle($ids);
     }
     $this->cache->cleanup();
     return $res;
 }
Esempio n. 2
0
 /**
  * Löscht News in der Datenbank
  * @return bool
  */
 public function delete()
 {
     if ($this->config->articles_trash && !$this->forceDelete) {
         $this->cache->cleanup(false, \fpcm\model\articles\article::CACHE_ARTICLE_MODULE);
         $this->deleted = 1;
         return $this->update();
     }
     $this->deleteRevisions();
     $commentList = new \fpcm\model\comments\commentList();
     $commentList->deleteCommentsByArticle($this->id);
     return parent::delete();
 }