Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

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