views:

100

answers:

1

Hey there, does anyone know the best practice to filter all the results I'm getting from any Zend_Db class.

It's because I've got a whole database with timestamps as INTs and I want to change the fields into Mysql's TIMESTAMP without having to change too much code.

It would be nice if I could apply a global database filter using strtotime on every TIMESTAMP field.

Any Idea?

Thanks!

+2  A: 

If you are using Zend_Db_Table you can define a custom row class, which takes care of the filtering. See Zend framework documentation

If you are using plain Zend_Db you can use Zend_Db_Statement::fetchObject() to retrieve a custom object. (fetchAll() with object fetchmode only returns stdClass afaik) in which you can implement the filtering code.

stroop