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

Issue Type: Bug Created: 2011-09-01T08:00:02.000+0000 Last Updated: 2011-09-01T08:06:18.000+0000 Status: Open Fix version(s): Reporter: Dolf Starreveld (dolfs) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Table

Related issues: Attachments:


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

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.