Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2057-2069 (lines=13) @@
2054
 *
2055
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2056
 */
2057
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2058
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2059
    if (empty($courseid)) {
2060
        $courseid = 0;
2061
    }
2062
    if (empty($bigbluebuttonbnid)) {
2063
        return $sql . " AND courseid = {$courseid}";
2064
    }
2065
    if ($subset) {
2066
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2067
    }
2068
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2069
}
2070
2071
/**
2072
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2081-2093 (lines=13) @@
2078
 *
2079
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2080
 */
2081
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2082
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2083
    if (empty($courseid)) {
2084
        $courseid = 0;
2085
    }
2086
    if (empty($bigbluebuttonbnid)) {
2087
        return $sql . " AND courseid = '{$courseid}'";
2088
    }
2089
    if ($subset) {
2090
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2091
    }
2092
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2093
}
2094
2095
/**
2096
 * Helper function to get recordings  and imported recordings together.