Beispiel #1
0
 public function getServiceConfig()
 {
     return array('abstract_factories' => array(), 'aliases' => array(), 'factories' => array('UsersTable' => function ($sm) {
         // echo __METHOD__." is reached; test echo in line ".__LINE__;
         $tableGateway = $sm->get('UsersTableGateway');
         $table = new UsersTable($tableGateway);
         return $table;
     }, 'UsersTableGateway' => function ($sm) {
         //echo __METHOD__." is reached; test echo in line ".__LINE__;
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Users());
         return new TableGateway('users', $dbAdapter, null, $resultSetPrototype);
     }, 'LoginForm' => function ($sm) {
         $form = new LoginForm();
         $form->setInputFilter($sm->get('LoginFormFilter'));
         return $form;
     }, 'RegisterForm' => function ($sm) {
         $form = new RegisterForm();
         $form->setInputFilter($sm->get('RegisterFormFilter'));
         return $form;
     }, 'UserEditForm' => function ($sm) {
         $form = new UserEditForm();
         $form->setInputFilter($sm->get('UserEditFormFilter'));
         return $form;
     }, 'UserAddForm' => function ($sm) {
         $form = new UserAddForm();
         $form->setInputFilter($sm->get('UserAddFormFilter'));
         return $form;
     }, 'LoginFormFilter' => function ($sm) {
         return new LoginFormFilter();
     }, 'RegisterFormFilter' => function ($sm) {
         return new RegisterFormFilter();
     }, 'UserEditFormFilter' => function ($sm) {
         return new UserEditFormFilter();
     }, 'UserAddFormFilter' => function ($sm) {
         return new UserAddFormFilter();
     }), 'invokables' => array(), 'services' => array(), 'shared' => array());
 }
Beispiel #2
0
 public function getServiceConfig()
 {
     return ['abstract_factories' => [], 'aliases' => [], 'factories' => ['UserTable' => function ($sm) {
         $tableGateway = $sm->get('UserTableGateway');
         $table = new UserTable($tableGateway);
         return $table;
     }, 'UserTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new User());
         return new TableGateway('user', $dbAdapter, null, $resultSetPrototype);
     }, 'LoginForm' => function ($sm) {
         $form = new LoginForm();
         $form->setInputFilter($sm->get('LoginFilter'));
         return $form;
     }, 'RegisterForm' => function ($sm) {
         $form = new RegisterForm();
         $form->setInputFilter($sm->get('RegisterFilter'));
         return $form;
     }, 'UserEditForm' => function ($sm) {
         $form = new UserEditForm();
         $form->setInputFilter($sm->get('UserEditFilter'));
         return $form;
     }, 'LoginFilter' => function ($sm) {
         return new LoginFilter();
     }, 'RegisterFilter' => function ($sm) {
         return new RegisterFilter();
     }, 'UserEditFilter' => function ($sm) {
         return new UserEditFilter();
     }, 'AuthService' => function ($sm) {
         $authService = new AuthenticationService();
         $authService->setAdapter($sm->get('TableAuthAdapter'));
         return $authService;
     }, 'TableAuthAdapter' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         return new DbTableAuthAdapter($dbAdapter, 'user', 'email', 'password', 'MD5(?)');
     }], 'invokables' => [], 'services' => [], 'shared' => []];
 }