Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created June 5, 2013 00:51
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/5710850 to your computer and use it in GitHub Desktop.
Save eminetto/5710850 to your computer and use it in GitHub Desktop.
public function getServiceConfig()
{
return array(
'factories' => array(
'Application\Model\Item' => function($sm) {
return new Item();
},
'ItemTableGateway' => function($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype($sm->get('Application\Model\Item'));
$tableGateway = new TableGateway('item', $dbAdapter, null, $resultSetPrototype);
$table = new ItemTable($tableGateway);
return $table;
},
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment