protected function _delete() { // Decrement parent forum count $category = $this->getParent(); $category->forum_count = new Zend_Db_Expr('forum_count - 1'); $category->save(); // Delete all child topics $table = Engine_Api::_()->getItemTable('forum_topic'); $select = $table->select()->where('forum_id = ?', $this->getIdentity()); foreach ($table->fetchAll($select) as $topic) { $topic->delete(); } parent::_delete(); }