mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
getRepository() doesn't use specified persistentManagerName connection #6839
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sterichards on GitHub (Oct 2, 2021).
Bug Report
Summary
Passing in the 2nd parameter of getRepository() as a connection name doesn't attempt t use that connection
Current behavior
How to reproduce
$this->getDoctrine()->getRepository(Entity::class, 'ConnectionDefinedInDoctrineCOnfig')->findAll();
Expected behavior
Doctrine to use the connection URL defined in the config
@sterichards commented on GitHub (Oct 2, 2021):
I have fixed this by changing the order of the entity_manager definitions in the
ormsection of doctrine.yamlDefining
defaultfirst causes the issue. Once I defined the custom entity manager first, everything worked