ZF-11713: When using Zend_Db_Table_Row with _transformColumn setFromArray does not work correctly (and also __construct)


Create a sub class of Zend_Db_Table_Row with an implemention/override of _transformColumn that actually changes names. Create a new row using the class. Call setFromArray on the object with an array with keys that are supposed to be transformed to new names. Notice no values actually make it into the object.

Issue is that setFromArray (and also __construct for that matter) do not call _transformColumn. setFromArray in particular also performs and array_intersect before setting values via __set. Because the incoming keys have not been transformed first, and the intersect only looks at already transformed names, the result is an empty array and no calls to __set are even made.

Should be fixed, but work around: In the sub-class also implement setFromArray and do it right by effectively implementing the intersect in the pre-transform set of names.


No comments to display