Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

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