Zend Code Generator on Google Code
September 17, 2009 by Reboot · 4 Comments
I started a project to create a zend code generator. It’s a pretty basic 3 layer model that it generates right now, tests included. Take a look at http://code.google.com/p/zend-code-generator/
Hi,
One question: where is the download. At google code it says: “This project currently has no downloads.”
You’re right, it’s only code now.
http://code.google.com/p/zend-code-generator/source/browse/#svn/standard/trunk/source
You need subversion to get it out.
Did not get around to a full release version, a bit of a time issue and I want to refactor the templates to use the Zend_CodeGenerator library.
I’ll also package it when it’s a little more user-friendly to setup and configure.
Hi Reboot,
Thanks for pointing me in the right direction, I just wanted to see where you are going with code generation. As I see It is a project in the making.
I am currently using Zend Framework for several projects but am trying to write a code generator to translate the data layer into a working representation in php (once and for all). I base it on examples seen in the reference guide at http://framework.zend.com/ using a DbTable class (TDG) a Mapper (Data mapper) and a Model class.
But I am looking for some examples or other people that have dealt with 1:1, 1:n and n:m relations. Just to get ideas.
What I have written for now generates the three classes, but doesn’t yet deal with the relations between tables. If you want you can check it out. I also have to convert to using Zend_Codegenerator. Basically it is a quick test I wrote, but I have found myself using it over and over.
Here is the Zend Framework Module download: http://www.sreknord.net/download#download3
Yes, it’s unfinished. I did create an enhanced version for work which also uses the Zend_CodeGenerator module. I, however, cannot bluntly copy in that piece of work (hence cannot mix business with pleasure). The relational bit is problematic because zend db does not provide data model references by means of introspection, must use another source or a strict naming convention.
Professionally I’m using the “DeZign” data modelling tool (from Datanamic) which could provide the necessary generation meta-data. Or, what you already mentioned, use the zend db table classes.
I’ll check out your code when I’ve got some spare time.
p.s. Lots to do in so little time :)
Best Regards,
Onno