Added by Jason Eisenmenger, last edited by Ralph Schindler on Nov 01, 2008  (view change)

Labels

 
(None)

Zend Framework: Zend_Paginator_Adapter_Doctrine - Jason Eisenmenger Component Proposal

Proposed Component Name Zend_Paginator_Adapter_Doctrine - Jason Eisenmenger
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Paginator_Adapter_Doctrine - Jason Eisenmenger
Proposers Jason Eisenmenger
Zend Liaison Ralph Schindler
Revision 1.0 - 5 September 2008: Initial Draft. (wiki revision: 9)

Table of Contents

1. Overview

Zend_Paginator_Adapter_Doctrine is an alternative to DbTable and allows the use of Doctrine

You may download the latest working class here

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will work as a drop-in replacement to DbTable.

4. Dependencies on Other Framework Components

  • Zend_Paginator
  • Zend_Paginator_Exception
  • Zend_Paginator_Adapter_Interface

5. Theory of Operation

Exactly the same as DbTable

6. Milestones / Tasks

  • Milestone 1: [DONE] Write proposal
  • Milestone 2: [DONE] Post working prototype
  • Milestone 3: [DONE] Review by community
  • Milestone 4: Working prototype checked into the incubator supporting use cases #1, #2, ...
  • Milestone 5: Working prototype checked into the incubator supporting use cases #3 and #4.
  • Milestone 6: Unit tests exist, work, and are checked into SVN.
  • Milestone 7: Initial documentation exists.

7. Class Index

  • Zend_Paginator_Adapter_Doctrine

8. Use Cases

UC-01: Standard Usage

UC-01: Supplying a count query

9. Class Skeletons

A lot of people seem to like Doctrine, so I'm in favor of adding an adapter for it =)

Maybe you can implement one for Propel too?

I've written one for Propel which uses the symfony DbFinder plugin to mimic Doctrine's query format.
But it is probably better to implement without that plugin.

Maybe it would also be a good idea to pass a Doctrine_Collection to the adapater, additional to Doctrine_Query. This would be a more generic approach.

Jason, your examples contain calls to setRouteName(), but those were only present in pre-release versions of Zend_Paginator. You should probably update your examples to reflect that.

Otherwise, looks good.

Zend Official Response

This proposal is accepted to the Zend Extras Incubator for development.

We would like to see the following concerns met:

  • This proposal and the proposal for Zend_Auth_Adapter_Doctrine_Table are combined into the ZendX_Doctrine namespace.
  • Name changed to ZendX_Doctrine_Paginator_Adapter or something similar
  • With this ZendX_Doctrine namespace, we would like to explore the possibility of allowing the top level class (presumably ZendX_Doctrine) to set up (bootstrap) this component for usage with doctrine- as well as checks to ensure that doctrine is available for use.