-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a persister and purger for Doctrine which operates on all known managers #108
base: master
Are you sure you want to change the base?
Conversation
@theofidry this looks good to me. 👍 I started reading the commits one by one and got confused where you undid what the first commit did, you should probably squash the branch since there's no original intent anymore. |
Indeed, I initially thought I could re-use some of the code but turned out not so much :) |
return new ObjectManagerPurger($manager, $purgeMode); | ||
}, | ||
$registry->getManagers() | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part here makes the assumption that data from all managers (and hence databases) should be purged every time.
IMHO this seems counter intuitive when running bin/console hautelook:fixtures:load --manager=foo
. I certainly wouldn't expect the database of manager bar
be also purged.
Looking at the problem from a wider perspective, perhaps it would be more sensible to remove the --manager
option and instead create a purger for only those managers which contain at least a single entity with fixtures defined for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that could be done I guess it would be less potential side-effects indeed... Either that or --manager
should restrict the purgers as well
Comes as a replacement to #99 and laying some groundwork for #107.
@dkarlovi I'm thinking of using the exact same strategy for registries. Right now we have persister/purger for one manager. This PR adds a tuple for a manager registry and then #107 could use a similar strategy to work with multiple registries. WDYT?