Working with objects - Component overview - Query - LIMIT and OFFSET - limiting the query results.php 274 Bytes
Newer Older
doctrine's avatar
doctrine committed
1 2
<?php

zYne's avatar
zYne committed
3
// find the first ten users and associated emails
doctrine's avatar
doctrine committed
4

zYne's avatar
zYne committed
5 6 7
$q = new Doctrine_Query();

$coll = $q->from('User u LEFT JOIN u.Email e')->limit(10);
doctrine's avatar
doctrine committed
8 9 10

// find the first ten users starting from the user number 5

zYne's avatar
zYne committed
11
$coll = $q->from('User u')->limit(10)->offset(5);
doctrine's avatar
doctrine committed
12 13

?>