Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

@@ 2009-2021 (lines=13) @@
2006
 *
2007
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2008
 */
2009
function bigbluebuttonbn_get_recordings_deleted_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2010
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2011
    if (empty($courseid)) {
2012
        $courseid = 0;
2013
    }
2014
    if (empty($bigbluebuttonbnid)) {
2015
        return $sql . " AND courseid = {$courseid}";
2016
    }
2017
    if ($subset) {
2018
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2019
    }
2020
    return $sql . " AND courseid = {$courseid} AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2021
}
2022
2023
/**
2024
 * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
@@ 2033-2045 (lines=13) @@
2030
 *
2031
 * @return string containing the sql used for getting the target bigbluebuttonbn instances
2032
 */
2033
function bigbluebuttonbn_get_recordings_imported_sql_select($courseid = 0, $bigbluebuttonbnid = null, $subset = true) {
2034
    $sql = "log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
2035
    if (empty($courseid)) {
2036
        $courseid = 0;
2037
    }
2038
    if (empty($bigbluebuttonbnid)) {
2039
        return $sql . " AND courseid = '{$courseid}'";
2040
    }
2041
    if ($subset) {
2042
        return $sql . " AND bigbluebuttonbnid = '{$bigbluebuttonbnid}'";
2043
    }
2044
    return $sql . " AND courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}'";
2045
}
2046
2047
/**
2048
 * Helper function to get recordings  and imported recordings together.