Code Duplication    Length = 10-13 lines in 3 locations

lib/Cake/Model/Datasource/Database/Postgres.php 1 location

@@ 645-654 (lines=10) @@
642
 * @param integer $offset Offset from which to start results
643
 * @return string SQL limit/offset statement
644
 */
645
	public function limit($limit, $offset = null) {
646
		if ($limit) {
647
			$rt = sprintf(' LIMIT %u', $limit);
648
			if ($offset) {
649
				$rt .= sprintf(' OFFSET %u', $offset);
650
			}
651
			return $rt;
652
		}
653
		return null;
654
	}
655
656
/**
657
 * Converts database-layer column types to basic types

lib/Cake/Model/Datasource/Database/Sqlite.php 1 location

@@ 376-385 (lines=10) @@
373
 * @param integer $offset Offset from which to start results
374
 * @return string SQL limit/offset statement
375
 */
376
	public function limit($limit, $offset = null) {
377
		if ($limit) {
378
			$rt = sprintf(' LIMIT %u', $limit);
379
			if ($offset) {
380
				$rt .= sprintf(' OFFSET %u', $offset);
381
			}
382
			return $rt;
383
		}
384
		return null;
385
	}
386
387
/**
388
 * Generate a database-native column schema string

lib/Cake/Model/Datasource/DboSource.php 1 location

@@ 2671-2683 (lines=13) @@
2668
 * @param integer $offset Offset from which to start results
2669
 * @return string SQL limit/offset statement
2670
 */
2671
	public function limit($limit, $offset = null) {
2672
		if ($limit) {
2673
			$rt = ' LIMIT';
2674
2675
			if ($offset) {
2676
				$rt .= sprintf(' %u,', $offset);
2677
			}
2678
2679
			$rt .= sprintf(' %u', $limit);
2680
			return $rt;
2681
		}
2682
		return null;
2683
	}
2684
2685
/**
2686
 * Returns an ORDER BY clause as a string.