-
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
Fix fill() method in Entity class #3377
Conversation
I confirm that this resolved issue #3368 . Thank you! |
This is a breaking change and IMO it is more of a philosophical change than a bug fix. There are legit reasons a developer may want to declare properties and have them filled but not included in |
@MGatner I can't agree with you as we should take a look at how this method looked like before: https://github.com/codeigniter4/CodeIgniter4/pull/2968/files From my perspective we simply forgot that parameters may be declared in the class and then |
I think you're right and that was an unintentional BC, but I don't know if it merits another BC to "fix" it. My personal opinion is I think this is a good change. As is, if someone had a field named "dates" and tried to fill it into an Entity it would really screw the class: |
Yeah the more I think about this the more I think you're right. We will need to note this as a minor breaking change - unlikely that many people will be affected but it could still mess something up. Can we start a |
I agree this should be fixed. The original intent was that you do exactly what @natanfelles did in his example. so, yes, make a note of it in the the Upgrade Guide that we should start maintaining and I think it's good. :) |
After reading back through the original post, I need to clarify. You should be able to do this:
Double-checking against the Model and the change is good. |
I've added info to the changelog. |
Description
When we declare class properties for Entity class then
__set()
method won't be called.See: #3368
Checklist: