public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if (parent::createService($serviceLocator)) {
         return new EMailAddressService($this->getObjectManager());
     }
     throw new \Exception("Failed to instantiate service.");
 }
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if (!parent::createService($serviceLocator)) {
         throw new \Exception("Object manager is missing.");
     }
     $authenticationService = $serviceLocator->get('Zend\\Authentication\\AuthenticationService');
     if ($authenticationService == null) {
         throw new \Exception("Authentication service is missing.");
     }
     return new AccountService($this->getObjectManager(), $authenticationService);
 }