Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

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