Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2525-2531 (lines=7) @@
2522
 *
2523
 * @return array
2524
 */
2525
function bigbluebuttonbn_view_instance_id($id) {
2526
    global $DB;
2527
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2528
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2529
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2530
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2531
}
2532
2533
/**
2534
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2540-2546 (lines=7) @@
2537
 *
2538
 * @return array
2539
 */
2540
function bigbluebuttonbn_view_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2541
    global $DB;
2542
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2543
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2544
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2545
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2546
}
2547
2548
/**
2549
 * Helper function renders general settings if the feature is enabled.