src/InfinityBase/Service/AbstractService.php
protected function identity()
    {
        // Get authentication service
        if (null === $this->identity) {
            $authenticationService = $this->getServiceLocator()
                    ->get('Zend\Authentication\AuthenticationService');
            if (!$authenticationService->hasIdentity()) {
                throw new \Exception('No identity loaded');
            }
            $this->identity = $authenticationService->getIdentity();
        }

        return $this->identity;
    }
protected function identity()
    {
        // Get authentication service
        if (null === $this->identity) {
            $authenticationService = $this->getServiceLocator()
                    ->get('Zend\Authentication\AuthenticationService');
            if (!$authenticationService->hasIdentity()) {
                throw new \Exception('No identity loaded');
            }
            $this->identity = $authenticationService->getIdentity();
        }

        return $this->identity;
    }
protected function identity ( ) { // Get authentication service if ( null === $ this -> identity ) { $ authenticationService = $ this -> getServiceLocator ( ) -> get ( 'Zend\Authentication\AuthenticationService' ) ; if ( ! $ authenticationService -> hasIdentity ( ) ) { throw new \ Exception ( 'No identity loaded' ) ; } $ this -> identity = $ authenticationService -> getIdentity ( ) ; } return $ this -> identity ; }
Get the current identity

@return User
Get the current identity