Created
September 22, 2015 10:58
-
-
Save diego-mi/76b29ef0eedd3558868e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Auth\Authentication\Factory; | |
use Auth\Authentication\Adapter; | |
use Zend\ServiceManager\FactoryInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
use Zend\Authentication\AuthenticationService; | |
use Zend\Authentication\Storage\Session; | |
class AuthenticationFactory implements FactoryInterface | |
{ | |
/** | |
* Create service | |
* | |
* @param ServiceLocatorInterface $serviceLocator | |
* @return mixed | |
*/ | |
public function createService(ServiceLocatorInterface $serviceLocator) | |
{ | |
$entityManager = $serviceLocator->get('Doctrine\ORM\EntityManager'); | |
return new AuthenticationService( | |
new Session(), | |
new Adapter($entityManager) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment