3

For some time now I'm playing with ZF2 and Doctrine 2 and I find them great. I don't have much experience with either of them, but I've been looking into multiple tutorials and sample apps. They gave me some idea about the libraries, but I'm not feeling comfortable with things like DQL and flushing the EM in the controller. I realize ZF2 is still a beta, but I hope there is some piece of code that shows a scalable structure that can be the skeleton of a real life app. Please share your experience and if possible provide sample source code.

Regards Valentin

karailiev
  • 124
  • 2
  • 9
  • possible duplicate of http://stackoverflow.com/questions/6137021/zend-framework-2-project-example – ilanco May 06 '12 at 14:59

2 Answers2

0

The skeleton is a skeleton of a real life app, that's what it is there for. If you want to hook up zf2 with doctrine, just install the DoctrineModule, and DoctrineORMModule (or ODM if that is what you want.)

DQL shouldn't really be in your controller, put it in a repository instead.

The EM can be flushed in your controller, but it can sometimes be better to set up an event listener, and then flush the EM once at the end of each request.

superdweebie
  • 1,576
  • 14
  • 23
0

http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/ - nice tutorial all what you need to setup ZF2-D2

Nikolai Senkevich
  • 2,370
  • 2
  • 19
  • 29