-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: add Entity::injectRawData()
to avoid name collision
#7208
feat: add Entity::injectRawData()
to avoid name collision
#7208
Conversation
adc2f12
to
7902b18
Compare
To be honest, I do not agree with this PR. |
Thank you for your comment.
Can you elaborate? elegant like in laravel explains nothing to me. |
To serve an entity setter and getter for attributes Otherwise, any new entity functionality (method names) will need to be adjusted for the fact that the developer may have an attribute with the same name. |
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.
I don't see the public requirement being necessary here, and it is a very likely breaking change. We can discuss it here, or my preference would be to split it out into a separate PR and proceed with the injection method.
7902b18
to
31a2e83
Compare
Indeed. I dropped it. |
@iRedds |
@kenjis The Sorry, but I don't agree with you. |
In my opinion, the In fact, the attributes holds all the data for the record, but that is just the current implementation. |
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.
Looks good! Re: getAttributes()... how is this different than toRawArray()?
31a2e83
to
63a00bb
Compare
Added changelog. |
I think this PR is ready to merge. @mostafakhudair @najdanovicivan Any comments? |
Thank you for the review! @MGatner @najdanovicivan |
Description
Supersedes #5763, #5781
Fixes #5762
Entity::injectRawData()
Entity::setAttributes()
require setter/getter methods must be public. See Bug: Entity can't handle column namedattributes
#5762 (comment)Checklist: