Skip to content

Instantly share code, notes, and snippets.

@MichaelGooden
Created August 19, 2013 11:31
Show Gist options
  • Save MichaelGooden/6268144 to your computer and use it in GitHub Desktop.
Save MichaelGooden/6268144 to your computer and use it in GitHub Desktop.
<?php
'factories' => array(
'My\Service\BankAccount' => function($serviceManager) {
$bankAccountService = new My\Service\BankAccount($serviceManager->get('Doctrine\ORM\EntityManager')->getRepository('My\Entity\BankAccount'));
return $bankAccountService;
},
),
<?php
public function indexAction() {
$service = $this->getServiceLocator()->get('My\Service\BankAccount');
return new ViewModel(array('account' => $service->find($id)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment