Simple row Hydration in Zend 1

Simple Row HydrationOne concept I really like from Zend Framework 2 (ZF2) is Hydration.  If you have have done any web programming, gathering up form variables and stuffing them into a database/object can be a pain.  Frequently you will see something like:

The hydration concept is letting the objects, in this case the objects are simple arrays, do this mapping for themselves.  The key is using the same name for both the row name and field name.  This can be used to imply the mapping, letting you do something like:

ZF2 takes this concept much further, but at it’s simplest, this is the basic concept of object Hydration.

Leave a Reply