/**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceManager
  * @return mixed
  */
 public function createService(ServiceLocatorInterface $serviceManager)
 {
     $locator = $serviceManager->getServiceLocator();
     $viewHelper = new View\Helper\ZfcUserIdentity();
     $viewHelper->setAuthService($locator->get('zfcuser_auth_service'));
     return $viewHelper;
 }
Ejemplo n.º 2
0
 /**
  * @param string $setting
  * @param UserInterface $user
  * @return
  */
 public function getSetting($setting, UserInterface $user = null)
 {
     if (!$user) {
         $user = $this->zfcUserIdentity->__invoke();
     }
     return $this->userSettingsService->getvalue($setting, $user);
 }
 protected function _before()
 {
     $helper = new ZfcUserIdentity();
     $this->helper = $helper;
     $authService = $this->getMock('Zend\\Authentication\\AuthenticationService');
     $this->authService = $authService;
     $helper->setAuthService($authService);
 }
Ejemplo n.º 4
0
 public function setUp()
 {
     $helper = new ViewHelper();
     $this->helper = $helper;
     $authService = $this->getMock('Zend\\Authentication\\AuthenticationService');
     $this->authService = $authService;
     $helper->setAuthService($authService);
 }
Ejemplo n.º 5
0
 /**
  * {@inheritDoc}
  */
 public function createService(ServiceLocatorInterface $pluginManager)
 {
     /* @var $pluginManager HelperPluginManager */
     $serviceManager = $pluginManager->getServiceLocator();
     /* @var $authService AuthenticationService */
     $authService = $serviceManager->get('zfcuser_auth_service');
     $viewHelper = new ZfcUserIdentity();
     $viewHelper->setAuthService($authService);
     return $viewHelper;
 }
Ejemplo n.º 6
0
 public function getViewHelperConfig()
 {
     return array('factories' => array('zfcUserDisplayName' => function ($sm) {
         $locator = $sm->getServiceLocator();
         $viewHelper = new View\Helper\ZfcUserDisplayName();
         $viewHelper->setAuthService($locator->get('zfcuser_auth_service'));
         return $viewHelper;
     }, 'zfcUserIdentity' => function ($sm) {
         $locator = $sm->getServiceLocator();
         $viewHelper = new View\Helper\ZfcUserIdentity();
         $viewHelper->setAuthService($locator->get('zfcuser_auth_service'));
         return $viewHelper;
     }, 'zfcUserLoginWidget' => function ($sm) {
         $locator = $sm->getServiceLocator();
         $viewHelper = new View\Helper\ZfcUserLoginWidget();
         $viewHelper->setLoginForm($locator->get('zfcuser_login_form'));
         return $viewHelper;
     }));
 }