Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i get row counts of Zend_Paginator object?

I am using Zend_Pagintor class with Zend_Db_Table_Abstract .

Zend_Pagintor has a count() method but it always returns 1!

How do i get row counts?

like image 734
rahim asgari Avatar asked Nov 12 '10 08:11

rahim asgari


2 Answers

You can use:

$paginator->getTotalItemCount();
like image 97
subosito Avatar answered Nov 09 '22 20:11

subosito


Pick the right one for your needs:

  • count returns the number of pages.
  • getAbsoluteItemNumber returns the absolute item number for the specified item.
  • getCurrentItemCount returns the number of items for the current page.
  • getItemCount returns the number of items in a collection.
  • getItemCountPerPage returns the number of items per page.
  • getTotalItemCount returns the total number of items available.

You are probably looking for getCurrentItemCount or getTotalItemCount

Check the API Docs for more details: http://framework.zend.com/apidoc/1.12

like image 27
Gordon Avatar answered Nov 09 '22 20:11

Gordon