Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2339-2345 (lines=7) @@
2336
 *
2337
 * @return array
2338
 */
2339
function bigbluebuttonbn_views_instance_id($id) {
2340
    global $DB;
2341
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2342
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2343
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2344
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2345
}
2346
2347
/**
2348
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2354-2360 (lines=7) @@
2351
 *
2352
 * @return array
2353
 */
2354
function bigbluebuttonbn_views_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2355
    global $DB;
2356
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2357
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2358
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2359
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2360
}
2361
2362
/**
2363
 * Helper function renders general warning message for settings (if any).