-
Notifications
You must be signed in to change notification settings - Fork 46
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
Allow to get target model after deep traversal #1052
Comments
@mvorisek Just some further food for discussion to make uses cases a bit clearer:
This would now fire an Exception, as removing the flag would move it out of the model scope of Now here is the idea:
If Atk4/Data knew which conditions might be released on scope validation checks, it could then be more flexible. So in this case only the customer_group condition would be checked to always be valid. OPTIONAL: Nevertheless, I believe there should be an easy way to also release those critical conditions: Take the use case that the account manager has the right to change a customer to be an end customer: the customers thus should be handled by end customer sales team. So concrete proposal:
Naturally speaking all those saves would mean saveAndUnload as after save the entity is no longer in the model scope. |
skipping (allowing to skip) whole scope is wrong and should not be part of the framework, so no however, your can achive that by creating a new model (and loading it) like you posted in the chat or maybe even easier by:
the following should work
I can think of some method like
|
@mvorisek That sounds practical to me and very logical. Any other thoughts from the community @DarkSide666 eventually? We should definitely then store those four lines of code above in a separate saveWeakly or saveOutOfScope function. |
When traversing on null value, we may allow the ID to change (to newly inserted). I will check what can be done and if it will not break other tests.
use case 2 - how should this work? Previously, the save conditions were relaxed, to me, incorrectly. What is the reasoning to relax save conditions when the entity cannot be loaded after?
A solution I can think of would be to implement Model::getModelWithoutRefConditions(). Currently, we do not store traversed reference info, so in $orderdoc, we have no info which condition to remove. Let's discuss this feature request later. If you have (or can put) your project into Github, I can code some helper methods specific to your projects.
The text was updated successfully, but these errors were encountered: