Also, I'm interested in relative topics about code generation. Share some interesting links I found:
http://sourceforge.net/projects/phpobjgen
http://www.qcodo.com/ (PHP5 only)
After looking the demo video of qcodo, I found I should have some tools besides the only text editor, Ultraedit. :)