-
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: [Model] add option $updateOnlyChanged #8455
Conversation
c999761
to
cbee64b
Compare
@@ -17,6 +17,8 @@ class {class} extends Model | |||
protected $protectFields = true; | |||
protected $allowedFields = []; | |||
|
|||
protected bool $updateOnlyChanged = true; |
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.
Maybe for better usability, we should default this to false?
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 think the default to false
is better.
So if we agree, I will change it.
It changes the update behavior, but existing apps do not seem to break.
So it is not a breaking change?
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 believe it would have side effects on existing apps. We should mention this change but not under "breaking changes".
+1 for false
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.
Since it's only for new models generated I wouldn't consider it a breaking change of any sort. Agree with @michalsn that maybe mention it, but not under breaking changes.
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.
Oh, you mean only change the value in the make:model
template.
I thought you meant both BaseModel and the template.
Isn't it confusing to change only the template?
👋 Hi, @kenjis! |
cbee64b
to
136d48e
Compare
136d48e
to
6a5ca0b
Compare
Added changelog. The value in |
Description
See https://forum.codeigniter.com/showthread.php?tid=87742
Checklist: