Beispiel #1
0
 /**
  * Удаление категории
  * @param int $id ID категории
  * @return null
  * @throws EngineException
  */
 public function delete($id)
 {
     $id = (int) $id;
     if (!$this->cats->get($id)) {
         throw new EngineException();
     }
     $ids = array();
     $this->cats->get_children_ids($id, $ids);
     $ids[] = $id;
     db::o()->p($ids)->delete('categories', 'WHERE id IN(@' . count($ids) . '?)');
     log_add('deleted_cat', 'admin', $id);
 }