PDA

View Full Version : Generate Model (and Store) classes from PHP/YAML/ORM Model classes?



cml
13 Dec 2013, 4:55 AM
Hi there,

I really love the setup of ExtJS4 and am now creating my Model classes.

I already have a back-end REST api built on Zend Framework 2 using Doctrine 2 and ORM Designer. So I completely generated all my PHP Entities and Repository classes. The manual work was only to implement the Controllers and Service Layer, and some little customisation in the Respositories.

Now, I would like to follow a similar approach to generate my ExtJS Model classes, and if possible/needed, also my ExtJS Store classes. Is this possible?

- Is there, for example, a possibility to generate the ExtJS Model from ORM Designer YAML annotations?
- Or, is there a library to convert/generate my PHP Entities into ExtJS Model classes?

It sounds like this is a very much wanted function, but I cannot find anything useful on Google. It would be a lot of double work to completely hand code my ExtJS Model again in javascript (I have about 40 entities in my server-side PHP model).

Hope someone can give me a hint, or would like to participate in creating a solution!

Thanks!
Marco

Kevin Jackson
19 Dec 2013, 8:48 AM
Sencha Cmd doesn't have a way to generate models using a database/schema. Cmd makes Ant scripting available so that might be an avenue to investigate. Server-side file generation is outside the scope of our support but perhaps someone in the community has done something similar and can provide you with some insights

cml
20 Dec 2013, 2:27 AM
Thanks for your Response Kevin. So it seams there is nothing like this, really strange.. :-?

I wasn't asking about server-side file generation though, so I don't know if you really understood my question..

Anyways, I will (try to) write a script that will take my ORM Designer model Entities (yml files) and parse them to write the ExtJS Model and Store class files as output. If anyone is interested to participate, please let me know.

Marco