/** * * @param <type> $from_post_id * @return array */ public function build_hierarchy($root_post_id = 0) { if (!is_numeric($root_post_id)) { throw new DBForumException( '$from_post_id must be numeric'); } try { $result = array(); $all_posts = $this->db->quick_query( "SELECT * FROM ".self::FCORE_FORUM_POST." WHERE ".self::FORUM_ID."=$this->forum_id ORDER BY ".self::POSTORDER, true); if ($all_posts == null) { return null; } return $this->to_flatten_array( $this->find_includes($root_post_id, $all_posts)); } catch(Exception $e) { throw new DBForumException($e->getMessage()); } }
/** * */ public function delete_all() { try { $this->conn->quick_query( "DELETE FROM ".$this->config_map[self::DB_TABLE_NAME] ); $this->conn->commit(); } catch(DBConnectException $e) { $this->conn->rollback(); FCore::GetLogger()->log(Logger::LEVEL_ERROR, $e->getMessage()); throw new DBFactoryException( "An Error Occurred While Attempting To Delete: ", $e); } }