* @copyright 2010-2014 Justin Swanhart and André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * @version SVN: $Id: LimitBuilder.php 830 2013-12-18 09:35:42Z phosco@gmx.de $ * */ require_once dirname(__FILE__) . '/../exceptions/UnableToCreateSQLException.php'; /** * This class implements the builder LIMIT statement. * You can overwrite all functions to achieve another handling. * * @author André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * */ class LimitBuilder { public function build($parsed) { $sql = ($parsed['offset'] ? $parsed['offset'] . ", " : "") . $parsed['rowcount']; if ($sql === "") { throw new UnableToCreateSQLException('LIMIT', 'rowcount', $parsed, 'rowcount'); } return "LIMIT " . $sql; } } ?>