Ok, for accurate pagination, you need to count the # of records matching a given criteria... so there’s the getCount() method:
http://rtfm.modx.com/display/xPDO20/xPDO.getCount
e.g.
$total = $my_xpdo->getCount();
But how do we pass it criteria, especially if we’ve built it up using separate clauses, e.g.
$query = $my_xpdo->newQuery('Vendors');
$query->where(array(
'name:LIKE' => "%$search_term%",
'OR:city:LIKE' => "%$search_term%"
)
);
$query->andCondition(array('is_published' => '1') ); # Little safety valve
How would I count the number of vendors there? I never had the full criteria in an array, so I can’t very well pass it to getCount()... any ideas here? Thanks!