Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

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