Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2309-2321 (lines=13) @@
2306
 *
2307
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2308
 */
2309
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2310
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2311
    if (empty($courseid)) {
2312
        $courseid = 0;
2313
    }
2314
    if (empty($bigbluebuttonbnid)) {
2315
        return $sql . " AND courseid = {$courseid}";
2316
    }
2317
    if ($subset) {
2318
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2319
    }
2320
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2321
}
2322
2323
/**
2324
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2333-2345 (lines=13) @@
2330
 *
2331
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2332
 */
2333
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2334
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2335
    if (empty($courseid)) {
2336
        $courseid = 0;
2337
    }
2338
    if (empty($bigbluebuttonbnid)) {
2339
        return $sql . " AND courseid = '{$courseid}'";
2340
    }
2341
    if ($subset) {
2342
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2343
    }
2344
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2345
}
2346
2347
/**
2348
 * Helper function to get recordings and imported recordings together.