lithium\data\source\Database::limit()

public method

Returns a LIMIT statement from the given limit and the offset of the context object.

Parameters

  • integer $limit
  • \lithium\data\model\Query $context

Returns

string

Source

	public function limit($limit, $context) {
		if (!$limit) {
			return;
		}
		if ($offset = $context->offset() ?: '') {
			$offset = " OFFSET {$offset}";
		}
		return "LIMIT {$limit}{$offset}";
	}