protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
 {
     $documentManager = $this->getHelper('documentManager')->getDocumentManager();
     $generator = new Generator($documentManager);
     $map = $generator->getResourceMap()->getMap();
     if (count($map) == 0) {
         $output->write('Nothing to generate' . PHP_EOL);
     }
     foreach ($map as $resourceName => $config) {
         $output->write(sprintf('Generating resource <info>%s</info>', $resourceName) . PHP_EOL);
         $generator->generate($resourceName);
     }
 }
 /**
  *
  * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
  * @return object
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $instance = new Generator();
     $instance->setResourceMap($serviceLocator->get('resourceMap'));
     return $instance;
 }