public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('lag.repository.repository_pool')) {
            return;
        }
        // find service with doctrine.repository tag
        $repositoryTags = $container->findTaggedServiceIds('doctrine.repository');
        // get pool definition
        $poolDefinition = $container->findDefinition('lag.repository.repository_pool');

        foreach ($repositoryTags as $serviceId => $tags) {
            // add repository to the pool
            $poolDefinition->addMethodCall('add', [
                new Reference($serviceId),
            ]);
        }
    }