Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

DAL - Add option during update / upsert that removes all non provided relation entities, e.g. product visibility (similar to doctrine's orphan removal) #3124

Closed
AndreasA opened this issue Mar 8, 2022 · 2 comments

Comments

@AndreasA
Copy link
Contributor

AndreasA commented Mar 8, 2022

Effort: middle (probably)

Description:

I had the requirement quite often to update entities (upsert or update) with relations, where if the related entity was not provided, it should bedeleted, so e.g. one can easily create new relations and remove unused ones (and maybe update related entities if necessary).
Should probably only be done for associations where an array is provided, if nothing exists then no update should happen. And it should be optional and not enabled by default.

This would be similar to doctrine's orphan removal.

It would also be helpful when e.g. updating a sales channel through code and adjusting its assigned language list, provided language relations are kept or created and others are removed. Especially as due to the requirement for keeping the system language relation, it isn't just possible to delete all relations and then add new ones.

Benefits

see description.

Break strategy

As it is an optional setting, it wouldn't break anything as long as it isn't used. Either by adding an optional parameter to the methods (which as iti s optional doesn't provide an issue on overrides) or by adding an additional state to the context object.

@AndreasA
Copy link
Contributor Author

AndreasA commented Mar 8, 2022

might be related to #3125

@OliverSkroblin OliverSkroblin transferred this issue from shopwareArchive/proposal Jun 16, 2023
@shopware shopware locked and limited conversation to collaborators Jun 16, 2023
@OliverSkroblin OliverSkroblin converted this issue into discussion #3149 Jun 16, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant