Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2651-2657 (lines=7) @@
2648
 *
2649
 * @return array
2650
 */
2651
function bigbluebuttonbn_view_instance_id($id) {
2652
    global $DB;
2653
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2654
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2655
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2656
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2657
}
2658
2659
/**
2660
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2666-2672 (lines=7) @@
2663
 *
2664
 * @return array
2665
 */
2666
function bigbluebuttonbn_view_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2667
    global $DB;
2668
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2669
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2670
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2671
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2672
}
2673
2674
/**
2675
 * Helper function renders general settings if the feature is enabled.