-
Notifications
You must be signed in to change notification settings - Fork 56
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
SelectArrayGently plugin #658
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Antikon - thats a great change, thank you very much - even though the name "gently" is uncommon, i like it 👍
i just have added some phpdoc request changes, and please add a changelog. thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing, you write ...override the values from the database.
but i think you mean that value of that attributes does not recieve "the value" and recieves the "key" instead? 😳
Or are you reffering to your example code new Query()->all()
? Sorry for the delay
Sorry, I didn't get exactly what you mean. Initial 'SelectArray' plugin changes the model's attributes values which came from DB using |
Ok, i see. I think my description in 👍 Could we then not just make a new class like class SelectArrayGently from SelectArray
{
public $assignAfterFind = false;
} Is there any difference to your code? Is the new Angular Directive Required? |
Ок, let me explain once more. Let's assume we have 'Country' and 'City' models.
We also have in 'City' model
This behavior can be disabled by Thus, the behavior of the |
👍 |
What are you changing/introducing
A new ngrest plugin which is similar to SelectArray plugin.
What is the reason for changing/introducing
The SelectArray plugin has bad behavior, which leads to a change in the model attribute (see #439). This behavior can be disabled by assignAfterFind option (#444). Howewer, this option disables autoconversion of data in a list view also.
SelectArrayGently plugin has the advantages of original SelectArray plugin and has not its disadvantages.
QA