Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2660-2666 (lines=7) @@
2657
 *
2658
 * @return array
2659
 */
2660
function bigbluebuttonbn_view_instance_id($id) {
2661
    global $DB;
2662
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2663
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2664
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2665
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2666
}
2667
2668
/**
2669
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2675-2681 (lines=7) @@
2672
 *
2673
 * @return array
2674
 */
2675
function bigbluebuttonbn_view_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2676
    global $DB;
2677
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2678
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2679
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2680
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2681
}
2682
2683
/**
2684
 * Helper function renders general settings if the feature is enabled.