DependencyInjection/RepositoryCompilerPass.php
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),
            ]);
        }
    }
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),
            ]);
        }
    }
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 ) , ] ) ; } }
Load tagged repositories and add it to the repository pool

@param ContainerBuilder $container
Load tagged repositories and add it to the repository pool