views:

32

answers:

1

I found a few Zend sample applications but all of them use Zend_DbTable. Does anyone know of a full Zend example application built with Propel to learn from?

A: 

I don't know of any complete applications, though there are quite a few articles on how to set it up. Just make sure you initialize Propel in your bootstrap, and then use your Propel classes as per usual. There's nothing special about it...

How to Zend Framework with Propel ORM could be handy.

wimvds
I once worked on a Zend application with Propel in the backend. We wrapped all objects with a custom layer so no Propel objects would leave the Model layer "naked". The design was so good that the guy who maintains it now has heaps of time left to spend on Stack Overflow.
Jan Fabry
@Jan Fabry, Any plans to open source it or part of it as a live example. 2. What do you mean by no Propel objects would leave the Model layer "naked"?
sarimoto
sarimoto
@sarimoto: I can't open source it, I don't work there anymore. But [the answer Wim linked to](http://stackoverflow.com/questions/3796093/how-to-zend-framework-with-propel-orm/3796405#3796405) contains everything you need: just execute `Propel::init()' somewhere near the startup of your code and you're ready to go. Just make sure you configure Propel to build the files somewhere near your other application files, that leaves the include path simple.
Jan Fabry
@sarimoto: We introduced Propel when part of the application was already written, and it used `Mappers` that returned `Entities` in the Model layer. To preserve backwards compatibility, we let our controllers only talk to these mappers, which would only return entities. Over time, the mappers would be (thin) layers over Propel peer classes, and the entities were (even thinner) layers over Propel object classes. I don't know whether I would add that layer of abstraction again if I would restart today. They added some useful features, but most of them are included in the new versions of Propel.
Jan Fabry