For a select query I can add an extender and provide my custom Pager, but for an EntityFieldQuery, how do I do that ?

Should I extends the EntityFieldQuery and overrides the pager method ?

Comments

sylvain lecoy’s picture

If this is possible actually...

sylvain lecoy’s picture

Category: support » feature

Guys from irc couldn't find a solution either.. I think this can then be an interesting feature request for D7. What do you guys think ?

marcingy’s picture

Version: 7.x-dev » 8.x-dev

Features go into d8 first.

feo’s picture

+1, good proposition

krimos’s picture

Try this :
$result = db_select('entity_type','node')
->fields('field', array('id','value'))
->condition('uid', $account->uid)
->extend('PagerDefault')
->limit(5) // Default value is 10
->execute();

sylvain lecoy’s picture

Yes that's the point krimos, it is doable for a select query, db_select returns a SelectQuery object. However, I would like to have the same behaviour for EntityFieldQuery, I don't know if that is possible.

sylvain lecoy’s picture

Status: Active » Closed (duplicate)

Seems it will be taken over by #1801726: EntityFieldQuery v2.