mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
Add support for ManagerAwareCenterResolverInterface
Introduce ManagerAwareCenterResolverInterface to ensure resolvers can reference their manager. Added a trait for implementing the interface and updated the CenterResolverManager to initialize resolvers correctly.
This commit is contained in:
@@ -18,7 +18,14 @@ final readonly class CenterResolverManager implements CenterResolverManagerInter
|
||||
/**
|
||||
* @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers
|
||||
*/
|
||||
public function __construct(private iterable $resolvers = []) {}
|
||||
public function __construct(private iterable $resolvers = [])
|
||||
{
|
||||
foreach ($resolvers as $resolver) {
|
||||
if ($resolver instanceof ManagerAwareCenterResolverInterface) {
|
||||
$resolver->setResolverManager($this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function resolveCenters($entity, ?array $options = []): array
|
||||
{
|
||||
|
Reference in New Issue
Block a user