I've implemented something like this for my company. I'd be happy to
share with you if you'd like. Its fairly automatic as far as
automatic extensions. If the properly named class exists for the Row
or Rowset of the Model, the Table will use those classes when
returning Row or Rowsets.
Thanks
On Jan 26, 2007, at 8:53 AM, Taylor Barstow wrote:
Hi,
I'd like to add support for subclassing Zend_Db_Table_Row. Is this
already in the works or is this a worthwhile thing for me to work
on? It would probably be a pretty small patch. My goals would be:
1. To add a couple of static methods to allow the developer to
choose an application wide row subclass (much like
Zend::initRegistry())
2. To (perhaps in a second iteration) add support for subclassing
on the fly; for example, I might want to set a custom subclass for
the rows generated by each of my table modules so that I can add
domain methods.
Any thoughts?
My initial reason for doing this is so that I can implement
IteratorAggregate so that I can iterate over the row's properties.
toArray() is not sufficient because it returns the under_score
version of the column names, rather than the camelCaps version,
which is what exterior objects should be working with. But long
term, I think subclassing would be useful for other reasons as well.
Taylor
-Will