Code Duplication    Length = 13-17 lines in 2 locations

application/models/cms_admin.php 1 location

@@ 173-185 (lines=13) @@
170
     * @param int $id
171
     * @return bool|array
172
     */
173
    public function get_category($id) {
174
175
        $query = $this->db
176
            ->select('category.*, route.url')
177
            ->where('category.id', $id)
178
            ->join('route', 'route.id = category.route_id')->get('category', 1);
179
180
        if ($query->num_rows() > 0) {
181
            return $query->row_array();
182
        }
183
184
        return FALSE;
185
    }
186
187
    /**
188
     * Check if category is created

application/models/cms_base.php 1 location

@@ 205-221 (lines=17) @@
202
     * @param int $id
203
     * @return bool
204
     */
205
    public function get_category_by_id($id) {
206
207
        $query = $this->db
208
            ->select('category.*, route.url, route.parent_url')
209
            ->order_by('category.position', 'ASC')
210
            ->where('category.id', $id)
211
            ->join('route', 'category.route_id = route.id')
212
            ->get('category');
213
214
        if ($query->num_rows() > 0) {
215
            $categories = $query->row_array();
216
217
            return $categories;
218
        }
219
220
        return FALSE;
221
    }
222
223
    /**
224
     * @param int $id