foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Can I specify $persistentManagerName for repository?

Open kerstvo opened this issue 2 years ago • 3 comments

Hi! Thanks for awesome library!

Is there any possibility to specify $persistentManagerName here https://github.com/zenstruck/foundry/blob/1.x/src/Configuration.php#L189?

kerstvo avatar Apr 11 '23 07:04 kerstvo

Hello,

I don't see any problem to add this as a new parameter to Configuration::repositoryFor()

I'm just wondering something: the $objectOrClass here is not enough? does that mean we can have multiple managers for the same entity class?

nikophil avatar Apr 11 '23 08:04 nikophil

As I see here https://symfony.com/doc/current/doctrine/multiple_entity_managers.html - yes One entity can be managed by more than one entity manager

Or maybe I misunderstood something.

kerstvo avatar Apr 11 '23 08:04 kerstvo

ok, I just learnt something, I was thinking it was not possible!

nikophil avatar Apr 11 '23 08:04 nikophil