Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2203-2215 (lines=13) @@
2200
 *
2201
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2202
 */
2203
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2204
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2205
    if (empty($courseid)) {
2206
        $courseid = 0;
2207
    }
2208
    if (empty($bigbluebuttonbnid)) {
2209
        return $sql . " AND courseid = {$courseid}";
2210
    }
2211
    if ($subset) {
2212
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2213
    }
2214
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2215
}
2216
2217
/**
2218
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2227-2239 (lines=13) @@
2224
 *
2225
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2226
 */
2227
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2228
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2229
    if (empty($courseid)) {
2230
        $courseid = 0;
2231
    }
2232
    if (empty($bigbluebuttonbnid)) {
2233
        return $sql . " AND courseid = '{$courseid}'";
2234
    }
2235
    if ($subset) {
2236
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2237
    }
2238
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2239
}
2240
2241
/**
2242
 * Helper function to get recordings and imported recordings together.