Completed
Push — develop ( 2db7ad...3eb4d8 )
by Timothy
10:51
created

AbstractSQL   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A limit() 0 11 2
1
<?php
2
/**
3
 * Query
4
 *
5
 * SQL Query Builder / Database Abstraction Layer
6
 *
7
 * PHP version 5.4
8
 *
9
 * @package     Query
10
 * @author      Timothy J. Warren <[email protected]>
11
 * @copyright   2012 - 2015 Timothy J. Warren
12
 * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13
 * @link        https://git.timshomepage.net/aviat4ion/Query
14
 */
15
16
17
// --------------------------------------------------------------------------
18
19
namespace Query\Drivers;
20
21
/**
22
 * parent for database manipulation subclasses
23
 *
24
 * @package Query
25
 * @subpackage Drivers
26
 */
27
abstract class AbstractSQL implements SQLInterface {
28
29
	/**
30
	 * Limit clause
31
	 *
32
	 * @param string $sql
33
	 * @param int $limit
34
	 * @param int|bool $offset
35
	 * @return string
36
	 */
37
	public function limit($sql, $limit, $offset=FALSE)
38
	{
39
		$sql .= "\nLIMIT {$limit}";
40
41
		if (is_numeric($offset))
42
		{
43
			$sql .= " OFFSET {$offset}";
44
		}
45
46
		return $sql;
47
	}
48
}
49
// End of abstract_sql.php
50