Skip to content

Commit

Permalink
Merge pull request #964 from deguif/fix-cache-pool-service
Browse files Browse the repository at this point in the history
Fix non existent service when using symfony cache pools
  • Loading branch information
alcaeus committed May 13, 2019
2 parents 6e15d2d + 0ef81ed commit cc3e327
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DependencyInjection/DoctrineExtension.php
Expand Up @@ -739,7 +739,7 @@ protected function loadCacheDriver($driverName, $entityManagerName, array $drive
break;

case 'pool':
$serviceId = $this->createPoolCacheDefinition($container, $aliasId, $driverMap['pool']);
$serviceId = $this->createPoolCacheDefinition($container, $driverMap['pool']);
break;

case 'provider':
Expand Down Expand Up @@ -862,15 +862,15 @@ private function loadMessengerServices(ContainerBuilder $container) : void
$transportFactoryDefinition->addTag('messenger.transport_factory');
}

private function createPoolCacheDefinition(ContainerBuilder $container, string $aliasId, string $poolName) : string
private function createPoolCacheDefinition(ContainerBuilder $container, string $poolName) : string
{
if (! class_exists(DoctrineProvider::class)) {
throw new LogicException('Using the "pool" cache type is only supported when symfony/cache is installed.');
}

$serviceId = sprintf('doctrine.orm.cache.pool.%s', $poolName);

$definition = $container->register($aliasId, DoctrineProvider::class);
$definition = $container->register($serviceId, DoctrineProvider::class);
$definition->addArgument(new Reference($poolName));
$definition->setPrivate(true);

Expand Down

0 comments on commit cc3e327

Please sign in to comment.