ZF1 Doctrine2 Service Layer?

Use a Service Locator: You need to create an Action Helper and inject the EntityManager in it when you register it in the Front Controller. This Action Helper receives as parameter in the direct() method the name of the class of service. Inside this method you should try to instantiate the class of service requested, and return it (or throw an exception if the same is not found).

Let your service classes receive as parameter in the constructor the EntityManager. The rest should already be clear to you. In your controller you only need to use something like: SomeController extends Zend_Controller_Action { //... public function someAction () { $MyService = $this->_helper->myServiveLocator('MyService'); //... } }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions