. */ /** * OffsetClause = "OFFSET" integer * * @package Doctrine * @subpackage Query * @author Guilherme Blanco * @author Janne Vanhala * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class Doctrine_Query_Production_OffsetClause extends Doctrine_Query_Production { protected $_offset; public function execute(array $params = array()) { $this->_parser->match(Doctrine_Query_Token::T_OFFSET); $this->_parser->match(Doctrine_Query_Token::T_INTEGER); $this->_offset = $this->_parser->token['value']; return $this; } public function buildSql() { // [TODO] How to deal with different DBMS here? // The responsability to apply the limit-subquery is from // SelectStatement, not this object's one. return ' OFFSET ' . $this->_offset; } /** * Visitor support * * @param object $visitor */ public function accept($visitor) { $visitor->visitOffsetClause($this); } /* Getters */ public function getOffset() { return $this->_offset; } }