Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2286-2298 (lines=13) @@
2283
 *
2284
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2285
 */
2286
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2287
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2288
    if (empty($courseid)) {
2289
        $courseid = 0;
2290
    }
2291
    if (empty($bigbluebuttonbnid)) {
2292
        return $sql . " AND courseid = {$courseid}";
2293
    }
2294
    if ($subset) {
2295
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2296
    }
2297
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2298
}
2299
2300
/**
2301
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2310-2322 (lines=13) @@
2307
 *
2308
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2309
 */
2310
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2311
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2312
    if (empty($courseid)) {
2313
        $courseid = 0;
2314
    }
2315
    if (empty($bigbluebuttonbnid)) {
2316
        return $sql . " AND courseid = '{$courseid}'";
2317
    }
2318
    if ($subset) {
2319
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2320
    }
2321
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2322
}
2323
2324
/**
2325
 * Helper function to get recordings and imported recordings together.