Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2220-2232 (lines=13) @@
2217
 *
2218
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2219
 */
2220
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2221
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
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 define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2244-2256 (lines=13) @@
2241
 *
2242
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2243
 */
2244
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2245
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2246
    if (empty($courseid)) {
2247
        $courseid = 0;
2248
    }
2249
    if (empty($bigbluebuttonbnid)) {
2250
        return $sql . " AND courseid = '{$courseid}'";
2251
    }
2252
    if ($subset) {
2253
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2254
    }
2255
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2256
}
2257
2258
/**
2259
 * Helper function to get recordings and imported recordings together.