Skip to content

Instantly share code, notes, and snippets.

@eminetto
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eminetto/b6487feb6f0de85ada38 to your computer and use it in GitHub Desktop.
Save eminetto/b6487feb6f0de85ada38 to your computer and use it in GitHub Desktop.
'service_manager' => array(
'abstract_factories' => array(
'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
'Zend\Log\LoggerAbstractServiceFactory',
),
'aliases' => array(
'translator' => 'MvcTranslator',
),
'factories' => array(
'Application\Model\PostTableGateway' => function($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new Zend\Db\ResultSet\ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Application\Model\Post());
$tableGateway = new Zend\Db\TableGateway\TableGateway('posts', $dbAdapter, null, $resultSetPrototype);
$postTableGateway = new Application\Model\PostTableGateway($tableGateway);
return $postTableGateway;
},
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment