Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2326-2338 (lines=13) @@
2323
 *
2324
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2325
 */
2326
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2327
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2328
    if (empty($courseid)) {
2329
        $courseid = 0;
2330
    }
2331
    if (empty($bigbluebuttonbnid)) {
2332
        return $sql . " AND courseid = {$courseid}";
2333
    }
2334
    if ($subset) {
2335
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2336
    }
2337
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2338
}
2339
2340
/**
2341
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2350-2362 (lines=13) @@
2347
 *
2348
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2349
 */
2350
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2351
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2352
    if (empty($courseid)) {
2353
        $courseid = 0;
2354
    }
2355
    if (empty($bigbluebuttonbnid)) {
2356
        return $sql . " AND courseid = '{$courseid}'";
2357
    }
2358
    if ($subset) {
2359
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2360
    }
2361
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2362
}
2363
2364
/**
2365
 * Helper function to get recordings and imported recordings together.