<?
class feed extends db_object {

var $table_name = "feeds";

    function getFeedsList($start) {
        $res = array();
        $res["count"] = $this->find("count");
        if($res["count"] > 0) {
            $res["data"] = $this->findAll("id, title, url, icon, category_id", null, $start, "category_id DESC");
            for($i=0; $i<count($res["data"]); $i++) {
                $category = func_new("category", $res["data"][$i]["category_id"]);
                if(!$category->isEmpty()) {
                    $res["data"][$i]["category"] = $category->row["name"];
                } else {
                    $res["data"][$i]["category"] = "#Root";
                }
            }
        }
        return $res;
    }

}
?>