Code Duplication    Length = 5-5 lines in 4 locations

main/work/work.lib.php 1 location

@@ 1713-1717 (lines=5) @@
1710
    $direction = in_array(strtolower($direction), array('desc', 'asc')) ? $direction : 'desc';
1711
    $column = Database::escape_string($column);
1712
1713
    if ($getCount) {
1714
        $result = Database::query($sql);
1715
        $result = Database::fetch_array($result);
1716
        return $result['count'];
1717
    }
1718
1719
    $sql .= " ORDER BY $column $direction";
1720
    $sql .= " LIMIT $start, $limit";

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

@@ 3495-3499 (lines=5) @@
3492
		            src.session_id IN ($sessionsSQL)
3493
		            $keywordCondition
3494
		        ";
3495
        if ($getCount) {
3496
            $result = Database::query($sql);
3497
            $row = Database::fetch_array($result,'ASSOC');
3498
            return $row['count'];
3499
        }
3500
3501
        if (isset($from) && isset($limit)) {
3502
            $from = intval($from);

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

@@ 6218-6222 (lines=5) @@
6215
            $sql .= $limitCondition;
6216
        }
6217
6218
        if ($getCount) {
6219
            $result = Database::query($sql);
6220
            $row = Database::fetch_array($result);
6221
            return $row['total'];
6222
        }
6223
        $result = Database::query($sql);
6224
6225
        $html = null;

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

@@ 4402-4406 (lines=5) @@
4399
        if ($getSql) {
4400
            return $sql;
4401
        }
4402
        if ($getCount) {
4403
            $result = Database::query($sql);
4404
            $row = Database::fetch_array($result);
4405
            return $row['count'];
4406
        }
4407
4408
        $orderBy = null;
4409
        if ($getOnlyUserId == false) {