Example #1
0
 /**
  * Logout attempt
  *
  * @param   array|\Traversable                          $params
  * @param   \Zend\Session\ManagerInterface              $sessionManager
  * @param   \Zend\Authentication\AuthenticationService  $auth
  * @return  array
  */
 public function logout($params, ManagerInterface $sessionManager, ZendAuthenticationService $auth = null)
 {
     if (null === $auth) {
         $auth = $this->getAuthenticationService();
     }
     if ($params instanceof Traversable) {
         $params = ArrayUtils::iteratorToArray($params);
     }
     $event = new Event(Event::EVENT_LOGOUT, $auth, $params);
     $event->setAuthenticationService($auth)->setSessionManager($sessionManager);
     $this->getEventManager()->trigger($event);
     return $event->getParams();
 }