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