Skip to content

Commit e2aa392

Browse files
committed
group and cache class
1 parent 69dc179 commit e2aa392

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Core/Factory/CacheFactory.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,20 @@ public static function dbStorage(
108108
public static function cachePoolFactory(
109109
string $storage,
110110
string|ObjectBuilderDefinition $serializer,
111+
?string $group = null,
112+
string $className = CachePool::class,
111113
): \Closure {
112114
return #[Factory]
113115
static function (
114116
Container $container,
115117
string $instanceName
116118
) use (
117119
$storage,
118-
$serializer
120+
$serializer,
121+
$group,
119122
): CachePool {
120-
$cacheTag = $instanceName;
121-
return new CachePool(
123+
$cacheTag = $group ?? $instanceName;
124+
return new $className(
122125
$container->resolve('cache.factories.storages.' . $storage, compact('instanceName', 'cacheTag')),
123126
$container->resolve($serializer),
124127
$container->get(LoggerInterface::class, tag: 'error')

0 commit comments

Comments
 (0)