Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

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