Proposed Component Name
Simon Mundy, Jack Sleight
Matthew Weier O'Phinney (Zend Liaison)
0.2 - 23 February 2008
0.1 - 9 December 2007 (wiki revision: 17)
Plugins are designed to allow business logic to be applied to Zend_Db_Table and associated rows/rowsets in an extensible, flexible manner. They act in a manner similar to MVC plugins, allowing access to Table, Rowset and Row objects both before and after read/write operations. Plugins are processed in FIFO order and it is possible to specify plugin loading order during instantiation.
The first method to add plugins is via the Plugin Broker, whereby each plugin attached is automatically added to each Zend_Db_Table upon instantiation. It is recommended to perform this operation prior to dispatch, ideally within a bootstrap - the Plugin Broker can receive a $config object or array to automate this procedure.
The second method is to add them on a per-table basis, either through configuration options or by the 'addPlugin' method. The '_plugin' property will allow array-based configuration (identical to that of the Plugin Broker) to create plugins and optionally pass options per-plugin.
Plugins can also be serialized with their respective Table/Rowset/Rows.
All 'pre' event methods return a null by default. This allows an operation to continue as expected, however this can be overidden by returning a non-null value. This may be useful for situations where the default behaviour is determined to be undesirable - for example, cancelling a 'delete' operation or returning a cached value instead of a 'live' query.
- Milestone 1: DONE Write proposal
- Milestone 2: IN PROGRESS Gather feedback and revise design as necessary
- Milestone 3: Review by the Zend team
- Milestone 4: Develop full implementation and unit tests
- Milestone 5: Initial documentation