<?php
/**
 * Copy Right IJH.CC
 * Each engineer has a duty to keep the code elegant
 * $Id$
 */

if(!defined('__CORE_DIR')){
    exit("Access Denied");
}

class Mdl_Cate_Cate extends Mdl_Table
{   
  
    protected $_table = 'cate';
    protected $_pk = 'cate_id';
    protected $_cols = 'cate_id,parent_id,title,orderby,intro,photo,deposit';

    protected $_pre_cache_key = 'cate-cate';
    
    public function options($shop_id)
    {
        $options = array();
        if($shop_id = (int)$shop_id){
            if($items = $this->items(array('shop_id'=>$shop_id))){
                foreach($items as $k=>$v){
                    $options[$k] = $v['title'];
                }
            }
        }
        return $options;
    }
}