Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2069-2081 (lines=13) @@
2066
 *
2067
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2068
 */
2069
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2070
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2071
    if (empty($courseid)) {
2072
        $courseid = 0;
2073
    }
2074
    if (empty($bigbluebuttonbnid)) {
2075
        return $sql . " AND courseid = {$courseid}";
2076
    }
2077
    if ($subset) {
2078
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2079
    }
2080
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2081
}
2082
2083
/**
2084
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2093-2105 (lines=13) @@
2090
 *
2091
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2092
 */
2093
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2094
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2095
    if (empty($courseid)) {
2096
        $courseid = 0;
2097
    }
2098
    if (empty($bigbluebuttonbnid)) {
2099
        return $sql . " AND courseid = '{$courseid}'";
2100
    }
2101
    if ($subset) {
2102
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2103
    }
2104
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2105
}
2106
2107
/**
2108
 * Helper function to get recordings  and imported recordings together.