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

@@ 2899-2915 (lines=17) @@
2896
     *
2897
     * @return bool
2898
     */
2899
    public function hasChildren($eventId, $courseId)
2900
    {
2901
        $eventId = intval($eventId);
2902
        $courseId = intval($courseId);
2903
2904
        $sql = "SELECT count(DISTINCT(id)) as count
2905
                FROM ".$this->tbl_course_agenda."
2906
                WHERE
2907
                    c_id = $courseId AND
2908
                    parent_event_id = $eventId";
2909
        $result = Database::query($sql);
2910
        if (Database::num_rows($result)) {
2911
            $row = Database::fetch_array($result, 'ASSOC');
2912
2913
            return $row['count'] > 0;
2914
        }
2915
2916
        return false;
2917
    }
2918