Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 2 locations

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