Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2280-2286 (lines=7) @@
2277
 *
2278
 * @return array
2279
 */
2280
function bigbluebuttonbn_views_instance_id($id) {
2281
    global $DB;
2282
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2283
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2284
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2285
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2286
}
2287
2288
/**
2289
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2295-2301 (lines=7) @@
2292
 *
2293
 * @return array
2294
 */
2295
function bigbluebuttonbn_views_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2296
    global $DB;
2297
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2298
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2299
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2300
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2301
}
2302
2303
/**
2304
 * Helper function renders general warning message for settings (if any).