Code Duplication    Length = 15-17 lines in 2 locations

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

@@ 50-64 (lines=15) @@
47
     *
48
     * @return string The glossary description
49
     */
50
    public static function get_glossary_term_by_glossary_id ($glossary_id)
51
    {
52
        $glossary_table  = Database::get_course_table(TABLE_GLOSSARY);
53
        $course_id = api_get_course_int_id();
54
        $sql = "SELECT description FROM $glossary_table
55
                WHERE c_id = $course_id  AND glossary_id =".intval($glossary_id);
56
        $rs = Database::query($sql);
57
        if (Database::num_rows($rs) > 0) {
58
            $row = Database::fetch_array($rs);
59
60
            return $row['description'];
61
        } else {
62
            return '';
63
        }
64
    }
65
66
    /**
67
     * Get glossary term by glossary id

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

@@ 2910-2926 (lines=17) @@
2907
     *
2908
     * @return bool
2909
     */
2910
    public function hasChildren($eventId, $courseId)
2911
    {
2912
        $eventId = intval($eventId);
2913
        $courseId = intval($courseId);
2914
2915
        $sql = "SELECT count(DISTINCT(id)) as count
2916
                FROM ".$this->tbl_course_agenda."
2917
                WHERE
2918
                    c_id = $courseId AND
2919
                    parent_event_id = $eventId";
2920
        $result = Database::query($sql);
2921
        if (Database::num_rows($result)) {
2922
            $row = Database::fetch_array($result, 'ASSOC');
2923
2924
            return $row['count'] > 0;
2925
        }
2926
2927
        return false;
2928
    }
2929