コード例 #1
0
 function get($name = '', $limit = 999)
 {
     $links = array();
     $this->db->select('*');
     $this->db->from(self::table_name);
     if ($name) {
         $this->db->where('name', $name);
     }
     $this->db->limit($limit);
     $this->db->order_by('name', 'ASC');
     $query = $this->db->get();
     foreach ($query->result() as $c) {
         $link = new Category_model();
         $link->_load_from_query($c);
         $links[$c->id] = $link;
     }
     return $links;
 }