Create mapper

@param ServiceLocatorInterface $serviceManager
@return PostMapper
164659
public function createService(ServiceLocatorInterface $serviceManager)
    {
        /** @var \Doctrine\ORM\EntityManager $objectManager */
        $objectManager = $serviceManager->get('Doctrine\ORM\EntityManager');

        /** @var \Eye4web\Zf2Board\Options\ModuleOptionsInterface $options */
        $options = $serviceManager->get('Eye4web\Zf2Board\Options\ModuleOptions');

        $mapper = new PostMapper($objectManager, $options);

        return $mapper;
    }
1326494
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config     = $serviceLocator->get('Config');
        $appRootDir = $config['parameters']['app.root_dir'];

        return new FileLocator($serviceLocator->get('ModuleManager'), $appRootDir);
    }
1303945
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $services = $serviceLocator->getServiceLocator();
        return $this->configureElement($serviceLocator->get('File'), $services);
    }
1230531
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator instanceof AbstractPluginManager ? $serviceLocator->getServiceLocator() : $serviceLocator;

        /** @var array $appConfig */
        $appConfig = $appServiceLocator->get('config');
        $moduleConfig = array_key_exists(Module::CONFIG_KEY, $appConfig) ? $appConfig[Module::CONFIG_KEY] : [];

        return new ModuleOptions($moduleConfig);
    }
505269
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($appServiceLocator instanceof AbstractPluginManager) {
            $appServiceLocator->getServiceLocator();
        }

        /** @var ObjectManagerAutoDetectorInterface $objectManagerAutoDetector */
        $objectManagerAutoDetector = $appServiceLocator->get(ObjectManagerAutoDetectorInterface::class);

        /** @var DoctrineObjectManagerInterface $objectManager */
        $objectManager = $appServiceLocator->get(DoctrineObjectManagerInterface::class);


        return new DoctrineObjectHydratorLocator($objectManagerAutoDetector, $objectManager);
    }
1240289
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($appServiceLocator instanceof AbstractPluginManager) {
            $appServiceLocator->getServiceLocator();
        }

        /** @var ObjectManagerAutoDetectorInterface $objectManagerAutoDetector */
        $objectManagerAutoDetector = $appServiceLocator->get(ObjectManagerAutoDetectorInterface::class);

        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsManager */
        $moduleOptionsManager = $appServiceLocator->get(ModuleOptionsPluginManagerInterface::class);
        /** @var ModuleOptionsInterface $moduleOptions */
        $moduleOptions = $moduleOptionsManager->get(ModuleOptionsInterface::class);

        /** @var DoctrineOrmModuleConfigInterface $doctrineOrmModuleConfig */
        $doctrineOrmModuleConfig = $appServiceLocator->get(DoctrineOrmModuleConfigInterface::class);

        return new OrmEntityLocator($objectManagerAutoDetector, $moduleOptions, $doctrineOrmModuleConfig);
    }
1228973
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var DataMapperManager $dataMapperManager */
        $dataMapperManager = $serviceLocator->get(DataMapperManager::class);

        $password = $serviceLocator->get('Thorr\OAuth2\DefaultPasswordInterface');

        /** @var ModuleOptions $moduleOptions */
        $moduleOptions = $serviceLocator->get(ModuleOptions::class);

        $adapter = new DataMapperAdapter($dataMapperManager, $password);
        $adapter->setUserClass($moduleOptions->getUserEntityClassName());

        return $adapter;
    }
88769
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $serviceManager = $serviceLocator->getServiceLocator();
        $helper = new Widget();
        $helper->setServiceLocator($serviceManager);
        $config = $serviceManager->get('Config');
        if (isset($config['view_helper_config']['widget'])) {
            $helper->setConfig($config['view_helper_config']['widget']);
        }

        return $helper;
    }
637696
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $fileTypeAdapters = $serviceLocator->getServiceLocator()->get("prooph.link.fileconnector.file_type_adapter_manager");

        return new FileManagerController($fileTypeAdapters->getAvailableFileTypes());
    }
453452
public function setServiceLocator(ServiceLocatorInterface $serviceManager)
    {
        if (!$this->dbAdapter instanceof DbAdapter) {
            $this->dbAdapter = $serviceManager->getServiceLocator()->get($this->dbAdapter);
        }
    }
781119
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var \Eye4web\Zf2Board\Options\ModuleOptions $options */
        $options = $serviceLocator->get('Eye4web\Zf2Board\Options\ModuleOptions');

        /** @var \Eye4web\Zf2Board\Mapper\TopicMapperInterface $mapper */
        $mapper = $serviceLocator->get($options->getTopicMapper());

        /** @var \Zend\Form\Form $topicCreateForm */
        $topicCreateForm = $serviceLocator->get('Eye4web\Zf2Board\Form\Topic\CreateForm');

        /** @var PostService $postService */
        $postService = $serviceLocator->get('Eye4web\Zf2Board\Service\PostService');

        $service = new TopicService($mapper, $topicCreateForm, $postService);

        return $service;
    }
443024
public function configureServiceManager(ServiceManager $serviceManager)
    {
        foreach ($this->config as $key => $value) {
            switch ($key) {
                case 'factories':
                    $this->configureFactories($serviceManager, $value);
                    break;
            }
        }
    }
898784
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $modelConfig = [];
        if (isset($config['matryoshka']) && isset($config['matryoshka']['model_manager'])) {
            $modelConfig = $config['matryoshka']['model_manager'];
        }
        return new ModelManager(new Config($modelConfig));
    }
400732
public function createService(ServiceLocatorInterface $controllerManager)
    {
        /* @var ControllerManager $controllerManager*/
        $serviceManager = $controllerManager->getServiceLocator();

        return $this->__invoke($serviceManager, null);
    }
390027
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return new ConnectionManager(
            $serviceLocator->get('prooph.link.app.config_location'),
            $serviceLocator->get('prooph.link.system_config.config_writer'),
            $serviceLocator->get('prooph.link.sqlconnector.dbal_connections')
        );
    }
353376
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $pluginManagerClass = static::PLUGIN_MANAGER_CLASS;
        $plugins = new $pluginManagerClass;
        $plugins->setServiceLocator($serviceLocator);
        $configuration    = $serviceLocator->get('Config');

        if (isset($configuration['di']) && $serviceLocator->has('Di')) {
            $di = $serviceLocator->get('Di');
            $plugins->addAbstractFactory(
                new DiAbstractServiceFactory($di, DiAbstractServiceFactory::USE_SL_BEFORE_DI)
            );
        }

        return $plugins;
    }
657371
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($serviceLocator instanceof AbstractPluginManager) {
            $appServiceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsPluginManager */
        $moduleOptionsPluginManager = $appServiceLocator->get(ModuleOptionsPluginManagerInterface::class);

        $resolverByModuleContextMap = new ResolverByClassName($moduleOptionsPluginManager);

        return $resolverByModuleContextMap;
    }