Hi ZF'ers
Forgive me for cross-posting but I wanted to make sure that as many
people as possible had a heads-up.
The Zend_Db_Table component has been added to the incubator in line
with the newly-accepted proposal. You can read more at http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Table+Query+Enhancements+-+Simon+Mundy
but for the time-poor amongst us here's the lowdown:-
- The ability to modify fetchRow and fetchAll queries from a Table
using a superclassed Zend_Db_Select object
- The ability to modify relational lookups from Zend_Db_Table_Row
using the same select method
- The ability to limit the number of columns fetched - it still
defaults to '*' but you now have the option of specifying an array of
columns instead.
- The ability to use expressions as columns - this results in a 'read
only' row or rowset but has many benefits (e.g. grouping rows,
evaluating columns, etc...)
- A new 'init' method providing a cleaner alternative than overriding
the __construct method (see Zend_Controller_Action for similar usage)
New documentation has been added to the incubator as well but it's
still in 0.1 draft stages - I hope to add to this in the coming
week(s). The proposal also details usage with some more 'real world'
examples. If anyone's unclear or feels they need expansion please let
me know.
NOTE: No unit testing has been added for these yet - Darby and myself
will be addressing this shortly, but currently these components are as-
is and use-at-your-own-risk. Having said that, in general testing and
usage they're performing quite well.
These changes are also API backwards compatible, so you can continue
to use the old ($where, $order, $limit, $offset) usage if you wish
(but why would you?!? :). The protected _fetch method is really only
the major change - it now accepts a Zend_Db_Table_Select object only.
Look forward to your feedback and I'll trawl JIRA for any bugs that
may appear in the meantime. The following issues relate directly to
this proposal:-
ZF-1674 - Allow row relationship methods to specify WHERE, ORDER and
LIMIT clauses
ZF-1549 - Add 'init' hook to Zend_Db_Table, Rowset and Row
ZF-694 - Specify columns to fetch in Zend_Db_Table
Cheerio
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
4124
http://www.peptolab.com