Code Duplication    Length = 13-13 lines in 2 locations

application/modules/gallery/models/gallery_m.php 2 locations

@@ 119-131 (lines=13) @@
116
            $sort_order = 'desc';
117
        }
118
119
        switch ($order_by) {
120
            case 'date':
121
                $this->db->order_by('created', $sort_order);
122
                break;
123
124
            case 'name':
125
                $this->db->order_by('gallery_albums_i18n.name', $sort_order);
126
                break;
127
128
            case 'position':
129
                $this->db->order_by('position', $sort_order);
130
                break;
131
        }
132
133
        $query = $this->db->get('gallery_albums');
134
@@ 372-384 (lines=13) @@
369
        $this->joinI18n($this->db, 'gallery_category', $locale);
370
        $this->db->select('*, gallery_category.id as id, gallery_category_i18n.name as name');
371
372
        switch ($order_by) {
373
            case 'date':
374
                $this->db->order_by('created', $sort_order);
375
                break;
376
377
            case 'name':
378
                $this->db->order_by('gallery_category_i18n.name', $sort_order);
379
                break;
380
381
            case 'position':
382
                $this->db->order_by('position', $sort_order);
383
                break;
384
        }
385
386
        $query = $this->db->get('gallery_category');
387