<?
class flash extends db_object {

var $table_name = "flash";

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

}
?>