Code Duplication    Length = 8-10 lines in 2 locations

main/inc/lib/course.lib.php 2 locations

@@ 175-182 (lines=8) @@
172
     * @author Patrick Cool <[email protected]>, Ghent University
173
     * @assert ('') === false
174
     */
175
    public static function get_course_information($course_code)
176
    {
177
        return Database::fetch_array(
178
            Database::query(
179
                "SELECT *, id as real_id FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
180
                WHERE code='" . Database::escape_string($course_code) . "'"), 'ASSOC'
181
        );
182
    }
183
184
    /**
185
     * Returns a list of courses. Should work with quickform syntax
@@ 309-318 (lines=10) @@
306
     * @return array with int fields "visibility", "subscribe", "unsubscribe"
307
     * @assert ('') === false
308
     */
309
    public static function get_access_settings($course_code)
310
    {
311
        return Database::fetch_array(
312
            Database::query(
313
                "SELECT visibility, subscribe, unsubscribe
314
                FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
315
                WHERE code = '" . Database::escape_string($course_code) . "'"
316
            )
317
        );
318
    }
319
320
    /**
321
     * Returns the status of a user in a course, which is COURSEMANAGER or STUDENT.