DependencyInjection/Neo4jExtension.php
private function handleEntityManagers(array &$config, ContainerBuilder $container, array $clientServiceIds): array
    {
        $serviceIds = [];
        foreach ($config['entity_managers'] as $name => $data) {
            $serviceIds[] = $serviceId = sprintf('neo4j.entity_manager.%s', $name);
            $clientName = $data['client'];
            if (empty($clientServiceIds[$clientName])) {
                throw new InvalidConfigurationException(sprintf(
                    'EntityManager "%s" is configured to use client named "%s" but there is no such client',
                    $name,
                    $clientName
                ));
            }

            $definition = class_exists(ChildDefinition::class)
                ? new ChildDefinition('neo4j.entity_manager.abstract')
                : new DefinitionDecorator('neo4j.entity_manager.abstract');

            $container
                ->setDefinition($serviceId, $definition)
                ->setArguments([
                    $container->getDefinition($clientServiceIds[$clientName]),
                    empty($data['cache_dir']) ? $container->getParameter('kernel.cache_dir').'/neo4j' : $data['cache_dir'],
                ]);
        }

        return $serviceIds;
    }
private function handleEntityManagers(array &$config, ContainerBuilder $container, array $clientServiceIds): array
    {
        $serviceIds = [];
        foreach ($config['entity_managers'] as $name => $data) {
            $serviceIds[] = $serviceId = sprintf('neo4j.entity_manager.%s', $name);
            $clientName = $data['client'];
            if (empty($clientServiceIds[$clientName])) {
                throw new InvalidConfigurationException(sprintf(
                    'EntityManager "%s" is configured to use client named "%s" but there is no such client',
                    $name,
                    $clientName
                ));
            }

            $definition = class_exists(ChildDefinition::class)
                ? new ChildDefinition('neo4j.entity_manager.abstract')
                : new DefinitionDecorator('neo4j.entity_manager.abstract');

            $container
                ->setDefinition($serviceId, $definition)
                ->setArguments([
                    $container->getDefinition($clientServiceIds[$clientName]),
                    empty($data['cache_dir']) ? $container->getParameter('kernel.cache_dir').'/neo4j' : $data['cache_dir'],
                ]);
        }

        return $serviceIds;
    }
@param array            $config
@param ContainerBuilder $container
@param array            $clientServiceIds

@return array