authenticationService instanceof AuthenticationServiceInterface) { throw new Exception\RuntimeException('No AuthenticationServiceInterface instance provided'); } if (! $this->authenticationService->hasIdentity()) { return; } return $this->authenticationService->getIdentity(); } /** * Set AuthenticationService instance * * @param AuthenticationServiceInterface $authenticationService * @return Identity */ public function setAuthenticationService(AuthenticationServiceInterface $authenticationService) { $this->authenticationService = $authenticationService; return $this; } /** * Get AuthenticationService instance * * @return AuthenticationServiceInterface */ public function getAuthenticationService() { return $this->authenticationService; } }