/**
  * @param ServiceLocatorInterface $serviceLocator
  * @return HelperPluginManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $hydrator = $this->getHydrator();
     $viewHelperManager = parent::createService($serviceLocator);
     $copy = array();
     $data = $hydrator->extract($serviceLocator->get('ViewHelperManager'));
     foreach ($this->properties as $key) {
         $copy[$key] = $data[$key];
     }
     $hydrator->hydrate($copy, $viewHelperManager);
     return $viewHelperManager;
 }
 /**
  * Creates a view helper manager
  * @param ServiceLocatorInterface $sm
  * @return HelperPluginManager
  */
 protected function createHelperPluginManager(ServiceLocatorInterface $sm)
 {
     $factory = new ViewHelperManagerFactory();
     /** @var HelperPluginManager $helperManager */
     $helperManager = $factory->createService($sm);
     $config = new Config($this->getSpecificConfig($sm, 'view_helpers'));
     $config->configureServiceManager($helperManager);
     return $helperManager;
 }