/** * Create and return a Auth instance * * @param ServiceLocatorInterface $serviceLocator * @return Auth */ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $config = isset($config['ze-auth']) && (is_array($config['ze-auth']) || $config['ze-auth'] instanceof ArrayAccess) ? $config['ze-auth'] : array(); $auth = new Auth(); $auth->setServiceManager($serviceLocator); $auth->setConfig($config); return $auth; }
/** * Return the logged user or null if not logged in * @return \ZeAuth\Db\MapperInterface */ public function user() { return $this->service->getLoggedUser(); }