xPDOQuery.limit
Last updated Dec 22nd, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$301 per month—let's make that $500!
Learn morexPDOQuery::limit¶
Add a LIMIT/OFFSET clause to the query.
Syntax¶
API Docs: 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);