You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: