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

Refactor ConsumeEventListener to simplify entity persistence #165

Closed
gimikus opened this issue Feb 26, 2015 · 0 comments · Fixed by #166
Closed

Refactor ConsumeEventListener to simplify entity persistence #165

gimikus opened this issue Feb 26, 2015 · 0 comments · Fixed by #166

Comments

@gimikus
Copy link
Contributor

gimikus commented Feb 26, 2015

Situation:
Now, ongr:import:full command pipeline's event listeners designed in way/paradigm what data is copied from source entity (document) to destination document. If onModify event listener do not creates document, onConsume event will skip this item.

Problem:
If you make some modifications to source entity it will be persisted only if document is set too (you override only persistDocument() method). If you need to persist only source entity from import item you have to override ConsumeEventListener setItem method, copy/paste method code and add entity persist after check what pipeline item is instance of correct class. ( https://github.com/ongr-io/ConnectionsBundle/blob/master/EventListener/AbstractImportConsumeEventListener.php#L108).
Solution could be:
It would be better just to implement persistence of entity if it is necessary.

@tfe2012 tfe2012 self-assigned this Mar 10, 2015
@tfe2012 tfe2012 added qa and removed in progress labels Mar 10, 2015
@tfe2012 tfe2012 removed their assignment Mar 16, 2015
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 a pull request may close this issue.

3 participants