Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CrudController, todo controller estende esse controller
- /********* Metodo Antigo ***********************
- //protected function getModelAntigo($name)
- // {
- // $class = '\Application\Model\\'.ucfirst($name).'Model';
- // return new $class($this->getAdapter(), $this->getServiceLocator());
- // }
- //*************************************************
- public function getModel($name)
- {
- return $this->getServiceLocator()->get($name.'Model');
- }
- // Application/Module.php
- public function getServiceConfig()
- {
- return array(
- 'factories' => array(
- 'AulaModel' => function($sm) {
- return new \Application\Model\AulaModel($sm->get('Zend\Db\Adapter\Adapter'),$sm);
- },
- 'AulaModeloModel' => function($sm) {
- return new \Application\Model\AulaModeloModel($sm->get('Zend\Db\Adapter\Adapter'),$sm);
- },
- 'CapituloModeloModel' => function($sm) {
- return new \Application\Model\CapituloModeloModel($sm->get('Zend\Db\Adapter\Adapter'),$sm);
- },
- 'CapituloModel' => function($sm) {
- return new \Application\Model\CapituloModel($sm->get('Zend\Db\Adapter\Adapter'),$sm);
- },
- ),
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment