I have a query that is extended by
PagerDefault. I need to get the total count of results to show something like: "There are a total of 100 results, now showing 21-40". I can't figure out where to get that number without building a separate query to run that doesn't use
First place I looked was
theme_pager(), which I'm already overriding in template.php. The total result count is not passed there, only the current page (as
I see that within
pager_default_initialize() only the current page number is sent to
theme_pager, although the total items are passed to that function. (So close!)
Then I thought I could clone the query, but the query must be extended prior to adding conditions, so that wouldn't work. I'll note that this isn't ideal either, because ideally, I would be able to get this total count without two db hits (as it would hit it for the count every time a user navigates the pagination).
So, does anyone know the best way to get the total count?