-
-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Description
Assuming the Foo
class is not in the default entity manager:
- works:
$objectManager = $managerRegistry->getManagerForClass(Foo::class);
$repository = $objectManager->getRepository(Foo::class);
- works:
$repository = $managerRegistry->getRepository(Foo::class, <manager name>);
- doesn't work (because
Foo
is looked into the default manager):
$repository = $managerRegistry->getRepository(Foo::class);
I would have thought the 3rd case would work: after all the manager registry can retrieve the correct manager using getManagerForClass()
internally.
Would it make sense to have getRepository()
use getManagerForClass()
internally to retrieve the repository in the correct manager?
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working