private function createMongoDbPersister($persisterName, array $persisterConfig, ContainerBuilder $container)
    {
        // Storage metadata
        $smfName = sprintf('%s.metadata', $persisterName);
        $definition = $this->createSmf();
        $container->setDefinition($smfName, $definition);

        // Configuration
        $configName = sprintf('%s.configuration', $persisterName);
        $definition = $this->createConfiguration($persisterName, $persisterConfig, $container);
        $container->setDefinition($configName, $definition);

        // Connection
        $conName = sprintf('%s.connection', $persisterName);
        $definition = $this->createConnection($persisterConfig, $configName);
        $container->setDefinition($conName, $definition);

        // Formatter
        $formatterName = sprintf('%s.formatter', $persisterName);
        $definition = $this->createFormatter();
        $container->setDefinition($formatterName, $definition);

        // Query
        $queryName = sprintf('%s.query', $persisterName);
        $definition = $this->createQuery($conName, $formatterName);
        $container->setDefinition($queryName, $definition);

        // Hydrator
        $hydratorName = sprintf('%s.hydrator', $persisterName);
        $definition = $this->createHydrator();
        $container->setDefinition($hydratorName, $definition);

        // Schema Manager
        $schemaManagerName = sprintf('%s.schema_manager', $persisterName);
        $definition = $this->createSchemaManager();
        $container->setDefinition($schemaManagerName, $definition);

        // Persister
        return new Definition(
            Utility::getLibraryClass('Persister\MongoDb\Persister'),
            [new Reference($queryName), new Reference($smfName), new Reference($hydratorName), new Reference($schemaManagerName)]
        );
    }
private function createMongoDbPersister($persisterName, array $persisterConfig, ContainerBuilder $container)
    {
        // Storage metadata
        $smfName = sprintf('%s.metadata', $persisterName);
        $definition = $this->createSmf();
        $container->setDefinition($smfName, $definition);

        // Configuration
        $configName = sprintf('%s.configuration', $persisterName);
        $definition = $this->createConfiguration($persisterName, $persisterConfig, $container);
        $container->setDefinition($configName, $definition);

        // Connection
        $conName = sprintf('%s.connection', $persisterName);
        $definition = $this->createConnection($persisterConfig, $configName);
        $container->setDefinition($conName, $definition);

        // Formatter
        $formatterName = sprintf('%s.formatter', $persisterName);
        $definition = $this->createFormatter();
        $container->setDefinition($formatterName, $definition);

        // Query
        $queryName = sprintf('%s.query', $persisterName);
        $definition = $this->createQuery($conName, $formatterName);
        $container->setDefinition($queryName, $definition);

        // Hydrator
        $hydratorName = sprintf('%s.hydrator', $persisterName);
        $definition = $this->createHydrator();
        $container->setDefinition($hydratorName, $definition);

        // Schema Manager
        $schemaManagerName = sprintf('%s.schema_manager', $persisterName);
        $definition = $this->createSchemaManager();
        $container->setDefinition($schemaManagerName, $definition);

        // Persister
        return new Definition(
            Utility::getLibraryClass('Persister\MongoDb\Persister'),
            [new Reference($queryName), new Reference($smfName), new Reference($hydratorName), new Reference($schemaManagerName)]
        );
    }
private function createMongoDbPersister ( $ persisterName , array $ persisterConfig , ContainerBuilder $ container ) { // Storage metadata $ smfName = sprintf ( '%s.metadata' , $ persisterName ) ; $ definition = $ this -> createSmf ( ) ; $ container -> setDefinition ( $ smfName , $ definition ) ; // Configuration $ configName = sprintf ( '%s.configuration' , $ persisterName ) ; $ definition = $ this -> createConfiguration ( $ persisterName , $ persisterConfig , $ container ) ; $ container -> setDefinition ( $ configName , $ definition ) ; // Connection $ conName = sprintf ( '%s.connection' , $ persisterName ) ; $ definition = $ this -> createConnection ( $ persisterConfig , $ configName ) ; $ container -> setDefinition ( $ conName , $ definition ) ; // Formatter $ formatterName = sprintf ( '%s.formatter' , $ persisterName ) ; $ definition = $ this -> createFormatter ( ) ; $ container -> setDefinition ( $ formatterName , $ definition ) ; // Query $ queryName = sprintf ( '%s.query' , $ persisterName ) ; $ definition = $ this -> createQuery ( $ conName , $ formatterName ) ; $ container -> setDefinition ( $ queryName , $ definition ) ; // Hydrator $ hydratorName = sprintf ( '%s.hydrator' , $ persisterName ) ; $ definition = $ this -> createHydrator ( ) ; $ container -> setDefinition ( $ hydratorName , $ definition ) ; // Schema Manager $ schemaManagerName = sprintf ( '%s.schema_manager' , $ persisterName ) ; $ definition = $ this -> createSchemaManager ( ) ; $ container -> setDefinition ( $ schemaManagerName , $ definition ) ; // Persister return new Definition ( Utility :: getLibraryClass ( 'Persister\MongoDb\Persister' ) , [ new Reference ( $ queryName ) , new Reference ( $ smfName ) , new Reference ( $ hydratorName ) , new Reference ( $ schemaManagerName ) ] ) ; }
Creates the MongoDB persister service definition.
Will also load support services.

@param   string              $persisterName
@param   array               $persisterConfig
@param   ContainerBuilder    $container
@return  Definition
Creates the MongoDB persister service definition . Will also load support services .