Pagination, RAR, eager loading (CActiveFinder)

With CActiveRecord I can call the count() method with a criteria applied and set the CPagination itemCount property before calling findAll(). Thus CLinkPager can display the appropriate number of page links.

On the other hand, if I use a RAR query there isn't a count() method in CActiveFinder. My current workaround is to call findAll() twice, populating the CPagination instance $page before the second call. Maybe CActiveFinder should have a count() as well?

/Tommy

Could you please create a ticket about this? Thanks.

Done (listed as a defect, could not select type: enhancement).

http://code.google.c…es/detail?id=63

Quote

I thought about this again and concluded that this is not needed... ...can be obtained by a direct call of count() of the

primary record

I guess I would need something similar to this SQL pseudo code:

SELECT COUNT(*) FROM (A JOIN (B JOIN C)) WHERE condition

condition: B.userId=C.userId

/Tommy