Code Duplication    Length = 5-6 lines in 6 locations

main/exercise/exercise.class.php 1 location

@@ 603-607 (lines=5) @@
600
601
            $limitCondition = null;
602
603
            if (isset($start) && isset($limit)) {
604
                $start = intval($start);
605
                $limit = intval($limit);
606
                $limitCondition = " LIMIT $start, $limit";
607
            }
608
            $sql .= $limitCondition;
609
            $result = Database::query($sql);
610
            $questions = array();

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

@@ 1921-1925 (lines=5) @@
1918
        }
1919
1920
        $limit_text = '';
1921
        if (isset($from) && isset($limit)) {
1922
            $from = intval($from);
1923
            $limit = intval($limit);
1924
            $limit_text = "LIMIT $from, $limit";
1925
        }
1926
1927
        if (count($relation_type) == 0) {
1928
            $where_relation_condition = '';

main/inc/lib/course.lib.php 2 locations

@@ 3298-3302 (lines=5) @@
3295
                    $whereConditions
3296
                $orderBy
3297
                ";
3298
        if (isset($from) && isset($limit)) {
3299
            $from = intval($from);
3300
            $limit = intval($limit);
3301
            $sql .= " LIMIT $from, $limit";
3302
        }
3303
3304
        $result = Database::query($sql);
3305
@@ 6182-6187 (lines=6) @@
6179
6180
        $sql .= $order;
6181
6182
        if (isset($start) && isset($maxPerPage)) {
6183
            $start = intval($start);
6184
            $maxPerPage = intval($maxPerPage);
6185
            $limitCondition = " LIMIT $start, $maxPerPage";
6186
            $sql .= $limitCondition;
6187
        }
6188
6189
        if ($getCount) {
6190
            $result = Database::query($sql);

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

@@ 3506-3510 (lines=5) @@
3503
            return $row['count'];
3504
        }
3505
3506
        if (isset($from) && isset($limit)) {
3507
            $from = intval($from);
3508
            $limit = intval($limit);
3509
            $sql .= " LIMIT $from, $limit";
3510
        }
3511
3512
        $result = Database::query($sql);
3513
        $num_rows = Database::num_rows($result);

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

@@ 5881-5886 (lines=6) @@
5878
5879
        $sql .= $order;
5880
5881
        if (isset($start) && isset($maxPerPage)) {
5882
            $start = intval($start);
5883
            $maxPerPage = intval($maxPerPage);
5884
            $limitCondition = " LIMIT $start, $maxPerPage";
5885
            $sql .= $limitCondition;
5886
        }
5887
5888
        $result = Database::query($sql);
5889
        $sessionsCategories = array();