Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2050-2062 (lines=13) @@
2047
 *
2048
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2049
 */
2050
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2051
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2052
    if (empty($courseid)) {
2053
        $courseid = 0;
2054
    }
2055
    if (empty($bigbluebuttonbnid)) {
2056
        return $sql . " AND courseid = {$courseid}";
2057
    }
2058
    if ($subset) {
2059
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2060
    }
2061
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2062
}
2063
2064
/**
2065
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2074-2086 (lines=13) @@
2071
 *
2072
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2073
 */
2074
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2075
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2076
    if (empty($courseid)) {
2077
        $courseid = 0;
2078
    }
2079
    if (empty($bigbluebuttonbnid)) {
2080
        return $sql . " AND courseid = '{$courseid}'";
2081
    }
2082
    if ($subset) {
2083
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2084
    }
2085
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2086
}
2087
2088
/**
2089
 * Helper function to get recordings  and imported recordings together.