Jump to main content Jump to doc navigation

xPDOQuery::limit

Add a LIMIT/OFFSET clause to the query.

Syntax

API Docs: http://api.modx.com/revolution/2.2/db_core_xpdo_om_xpdoquery.class.html#\xPDOQuery::limit()

xPDOQuery limit (integer $limit, [integer $offset = 0])

Example

Get Boxes 11-20, or the 2nd 10 Boxes.

$query = $xpdo->newQuery('Box');
$query->limit(10,10);
$boxes = $xpdo->getCollection('Box',$query);

See Also