Version 1 by Ralph Schindler
on Jul 22, 2010 06:55.

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (6)

View Page History

* MUST implement a component that subscribes to the Row Gateway pattern described in PoEAA
* MUST be able to accept Zend\Db\Metadata to understand the database schema in order to process row operations
* SHOULD be injectable into any Zend\Db\ResultSet such that any row can become a Row Gateway
* SHOULD be pluggable at various point in the runtime:
** pre-save & post-save
** pre-delete & post-delete
** pre-populate & post-populate

h4. Motivation & Discussion

* Currently, the Row Gateway is hard coupled to the Zend_Db_Table component. Ideally, rows inside any returned Zend\Db\ResultSet should be capable of implementing the Row Gateway regardless of where the Rowset originated from.
* Currently, the Row Gateway is hard coupled to the Zend_Db_Table component. If Row were decoupled from TableGateway, that would mean it can be used in any situation where a developer has retrieved a row from the database.. even in situations where they have issued SQL directly as a statement or to the adapter (prepared or not). This would allow the Zend\Db\ResultSet component to cast any row to a RowGateway object that supports the RowGateway pattern thus giving the developer the opportunity to have row objects delete() and save() themselves to/in persistent storage.
* Moreover, the RowGateway should also have the ability to be pluggable. This allows developers the maximum amount of flexibility in cases where they would like to use these row objects as the model or the subject of a model, OR the target for a mapper.

h3. MUST have a ZendTest\Db component
* This is a highly requested feature in Zend_Db but due to BC, it is very hard to implement. Moreover, this kind of solution can be considered very heavy in terms of CPU and performance costs, so making it a plugin allows developers to opt-in to this feature why the need these capabilities in their application.

h3. SHOULD COULD have a Zend\Db\ActiveRecord component

* MUST COULD create a component that subscribes and implements the ActiveRecord pattern as described in PoEAA

h4. Motivation & Discussion