Esempio n. 1
0
 public function getServiceConfig()
 {
     return array('factories' => array('Blvd\\Model\\BlvdTable' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $table = new BlvdTable($dbAdapter);
         return $table;
     }, 'Blvd\\Model\\BlvdMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $mapper = new BlvdMapper($dbAdapter);
         $mapper->setServiceLocator($sm);
         return $mapper;
     }, 'Blvd\\Model\\BlvdCategoryMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $mapper = new BlvdCategoryMapper($dbAdapter);
         return $mapper;
     }, 'Blvd\\Model\\BlvdJoinCategoryMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $mapper = new BlvdJoinCategoryMapper($dbAdapter);
         return $mapper;
     }, 'Blvd\\Model\\BlvdJoinCategoryTable' => function ($sm) {
         $tableGateway = $sm->get('BlvdJoinCategoryTableGateway');
         $table = new BlvdJoinCategoryTable($tableGateway);
         return $table;
     }, 'BlvdJoinCategoryTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new BlvdJoinCategory());
         return new TableGateway('blvd_categories', $dbAdapter, null, $resultSetPrototype);
     }, 'Blvd\\Model\\SocialMediaMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $mapper = new socialMediaMapper($dbAdapter);
         $mapper->setServiceLocator($sm);
         return $mapper;
     }));
 }
Esempio n. 2
0
 public function getServiceConfig()
 {
     return array('factories' => array('YelpMy\\Model\\YelpMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $mapper = new YelpMapper($dbAdapter);
         return $mapper;
     }, 'YelpMy\\Model\\YelpBlvd' => function ($sm) {
         $configArr = $sm->get('config');
         $model = new YelpBlvd($configArr['yelp']);
         return $model;
     }, 'Blvd\\Model\\BlvdMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $model = new BlvdMapper($dbAdapter);
         $model->setServiceLocator($sm);
         return $model;
     }, 'Blvd\\Model\\SocialMediaMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $model = new SocialMediaMapper($dbAdapter);
         $model->setServiceLocator($sm);
         return $model;
     }));
 }