« Return to Thread: Introducing Zend_Paginator_Adapter_TableSelect

Re: Introducing Zend_Paginator_Adapter_TableSelect

by valugi :: Rate this Message:

Reply to Author | View in Thread

I think is a very good idea.

Now the paginator only returns an ArrayIterator object even if you used an Zend_Paginator_Adapter_DbSelect and the Zend_Db_Select->from() only accepts a Zend_Db_Expression and maybe it will be a good idea to accept also a Zend_Db_Table.

I would like to have directly the Row objects to play with them :)

Jurriën Stutterheim wrote:
Hi all,


A few minutes ago I committed a new adapter for Zend_Paginator:  
Zend_Paginator_Adapter_TableSelect. As you would suspect, judging by  
the name, this adapter specializes in dealing with  
Zend_Db_Table_Select objects. The result of this specialization is  
that this new adapter is able to return Zend_Db_Table_Rowsets to the  
Paginator, which in turn is home to a collection of Zend_Db_Table_Rows.
The DbSelect adapter will continue to work as expected, even with  
Zend_Db_Table_Select instances being passed to it. In fact, the  
Paginator's factory method will continue to return a Paginator with  
the DbSelect adapter, even if you feed it a Zend_Db_Table_Select  
object! This has been done to preserve backward-compatibility for  
Zend_Paginator.

To resolve this minor inconvenience, I would like to propose a minor  
BC break for the Zend Framework 1.7 release. If the  
Zend_Paginator::factory() method is supplied with a  
Zend_Db_Table_Select object, I would like it to return a Paginator  
with a TableSelect adapter. You would still be able to use the  
DbSelect adapter with your Zend_Db_Table_Select objects if you wish,  
just not through the factory method : )

Please let me know what you think about this proposal!

Enjoy the new adapter!


- Jurriën


P.S.: You can find the new adapter on SVN

 « Return to Thread: Introducing Zend_Paginator_Adapter_TableSelect