Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

theofidry
Copy link
Owner

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?

  • Tests
  • Wiring the services

@theofidry theofidry changed the title Feature/multiple entity managers Add a persister and purger for Doctrine which operates on all known managers Oct 24, 2018
@dkarlovi
Copy link
Contributor

@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.

@theofidry
Copy link
Owner Author

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()
);
Copy link

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?

Copy link
Owner Author

@theofidry theofidry Aug 29, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants