DependencyInjection/ONGRConnectionsExtension.php
private function initSyncStorageForMysql(ContainerBuilder $container, array $config)
    {
        // Initiate MySQL storage manager.
        $doctrineConnection = sprintf('doctrine.dbal.%s_connection', $config['connection']);
        $definition = $container->getDefinition(
            'ongr_connections.sync.storage_manager.mysql_storage_manager'
        );
        $definition->setArguments(
            [
                new Reference($doctrineConnection, ContainerInterface::IGNORE_ON_INVALID_REFERENCE),
                $config['table_name'],
            ]
        );

        $definition->addMethodCall('setContainer', [new Reference('service_container')]);

        // Initiate SyncStorage and inject storage manager into it.
        $container->getDefinition('ongr_connections.sync.sync_storage')->setArguments(
            [$definition]
        );
    }
private function initSyncStorageForMysql(ContainerBuilder $container, array $config)
    {
        // Initiate MySQL storage manager.
        $doctrineConnection = sprintf('doctrine.dbal.%s_connection', $config['connection']);
        $definition = $container->getDefinition(
            'ongr_connections.sync.storage_manager.mysql_storage_manager'
        );
        $definition->setArguments(
            [
                new Reference($doctrineConnection, ContainerInterface::IGNORE_ON_INVALID_REFERENCE),
                $config['table_name'],
            ]
        );

        $definition->addMethodCall('setContainer', [new Reference('service_container')]);

        // Initiate SyncStorage and inject storage manager into it.
        $container->getDefinition('ongr_connections.sync.sync_storage')->setArguments(
            [$definition]
        );
    }
Set up Sync. storage with MySQL storage.

@param ContainerBuilder $container
@param array            $config