Code Duplication    Length = 5-5 lines in 5 locations

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

@@ 3075-3079 (lines=5) @@
3072
                    $whereConditions
3073
                $orderBy
3074
                ";
3075
        if (isset($from) && isset($limit)) {
3076
            $from = intval($from);
3077
            $limit = intval($limit);
3078
            $sql .= " LIMIT $from, $limit";
3079
        }
3080
3081
        $result = Database::query($sql);
3082

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

@@ 551-555 (lines=5) @@
548
        }
549
550
        $limit_text = '';
551
        if (isset($from) && isset($limit)) {
552
            $from = intval($from);
553
            $limit = intval($limit);
554
            $limit_text = "LIMIT $from, $limit";
555
        }
556
557
        if (count($relation_type) == 0) {
558
            $where_relation_condition = '';

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

@@ 1899-1903 (lines=5) @@
1896
        }
1897
1898
        $limit_text = '';
1899
        if (isset($from) && isset($limit)) {
1900
            $from = intval($from);
1901
            $limit = intval($limit);
1902
            $limit_text = "LIMIT $from, $limit";
1903
        }
1904
1905
        if (count($relation_type) == 0) {
1906
            $where_relation_condition = '';

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

@@ 3326-3330 (lines=5) @@
3323
            return $row['count'];
3324
        }
3325
3326
        if (isset($from) && isset($limit)) {
3327
            $from = intval($from);
3328
            $limit = intval($limit);
3329
            $sql .= " LIMIT $from, $limit";
3330
        }
3331
3332
        $result = Database::query($sql);
3333
        $num_rows = Database::num_rows($result);

main/exercice/exercise.class.php 1 location

@@ 614-618 (lines=5) @@
611
612
            $limitCondition = null;
613
614
            if (isset($start) && isset($limit)) {
615
                $start = intval($start);
616
                $limit = intval($limit);
617
                $limitCondition = " LIMIT $start, $limit";
618
            }
619
            $sql .= $limitCondition;
620
            $result = Database::query($sql);
621
            $questions = array();