Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2360-2366 (lines=7) @@
2357
 *
2358
 * @return array
2359
 */
2360
function bigbluebuttonbn_views_instance_id($id) {
2361
    global $DB;
2362
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2363
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2364
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2365
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2366
}
2367
2368
/**
2369
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2375-2381 (lines=7) @@
2372
 *
2373
 * @return array
2374
 */
2375
function bigbluebuttonbn_views_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2376
    global $DB;
2377
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2378
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2379
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2380
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2381
}
2382
2383
/**
2384
 * Helper function renders general warning message for settings (if any).