Code Duplication    Length = 12-13 lines in 2 locations

main/gradebook/lib/GradebookUtils.php 1 location

@@ 94-106 (lines=13) @@
91
     * @param    int     Link/Resource ID
92
     * @return   bool    false on error, true on success
93
     */
94
    public static function remove_resource_from_course_gradebook($link_id)
95
    {
96
        if (empty($link_id)) {
97
            return false;
98
        }
99
100
        // TODO find the corresponding category (the first one for this course, ordered by ID)
101
        $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
102
        $sql = "DELETE FROM $l WHERE id = ".(int)$link_id;
103
        Database::query($sql);
104
105
        return true;
106
    }
107
108
    /**
109
     * Block students

main/inc/lib/sessionmanager.lib.php 1 location

@@ 1539-1550 (lines=12) @@
1536
     *
1537
     * @return bool
1538
     */
1539
    public static function clear_session_ref_promotion($id_promotion)
1540
    {
1541
        $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
1542
        $id_promotion = intval($id_promotion);
1543
        $sql = "UPDATE $tbl_session SET promotion_id=0
1544
                WHERE promotion_id = $id_promotion";
1545
        if (Database::query($sql)) {
1546
            return true;
1547
        } else {
1548
            return false;
1549
        }
1550
    }
1551
1552
    /**
1553
     * Subscribes students to the given session and optionally (default) unsubscribes previous users