ZF-4675: Zend_Paginator_Adapter_Interface::getItems has wrong parameters

Issue Type: Bug Created: 2008-10-22T03:09:09.000+0000 Last Updated: 2008-11-13T14:10:28.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Roger Hunwicks (rhunwicks) Assignee: Jurrien Stutterheim (norm2782) Tags: - Zend_Paginator

Related issues: Attachments:


The parameter definition for Zend_Paginator_Adapter_Interface::getItems is different to the ones for Zend_Paginator_Adapter_DbSelect and Zend_Paginator_Adapter_DbTableSelect.

The Interface definition is:

<pre class="highlight">     /**
     * Returns a collection of items for a page.
     * @param  integer $pageNumber Page number
     * @param  integer $itemCountPerPage Number of items per page
     * @return mixed
    public function getItems($pageNumber, $itemCountPerPage);

whereas the DbSelect definition is:

<pre class="highlight">    /**
     * Returns an array of items for a page.
     * @param  integer $offset Page offset
     * @param  integer $itemCountPerPage Number of items per page
     * @return array
    public function getItems($offset, $itemCountPerPage)

I.e. the first parameter for the DbSelect is the offset, whereas for the Interface it is pageNumber. The call from $paginator->getItemsByPage() passes in the $offset, so this appears to be the correct usage.

I think the parameter definition in the interface should be changed


Posted by Jurrien Stutterheim (norm2782) on 2008-10-22T03:22:03.000+0000

Resolved in revision 12071

Posted by Wil Sinclair (wil) on 2008-11-13T14:10:28.000+0000

Changing issues in preparation for the 1.7.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.