Doctrine 2 Pagination with Association Mapping
问题 I am wondering how can you paginate the results obtained from an entity association mapping in Doctrine 2? For example class Customer { /** * @OneToMany(targetEntity="Order") */ private $orders; } can be used as such: $customer->getOrders(); which will return a collection of Order objects. The problem is when there are a large number of order objects. We can use Doctrine\ORM\Tools\Pagination\Paginator when building custom queries, however I do not see any way to hook into query generation