You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When snapshot data is saved to a Model, all attributes are being saved as string.
There can be issues regardless orm.cast_on_hydrate is turned on or off.
When orm.cast_on_hydrate is on, I think Model::cloneResultMap() should save the casted values to the snapshot data.
If it's off, then Model::getChangedFields() should not use === to check if the field has changed.
Any thoughts?
Details
Phalcon version: 4.0.x branch
The text was updated successfully, but these errors were encountered:
cloneResultMap should save casted values when cast_on_hydrate is on.
I'm not sure if I agree not to use === when cast_on_hydrate is off.
When cast_on_hydrate is off you should accept that all your model properties are strings and should set them as string. If you set it as int I'm expecting that hasChanged will detect a change.
When snapshot data is saved to a
Model
, all attributes are being saved asstring
.There can be issues regardless
orm.cast_on_hydrate
is turned on or off.Here is a quick example:
When
orm.cast_on_hydrate
is on, I thinkModel::cloneResultMap()
should save the casted values to the snapshot data.If it's off, then
Model::getChangedFields()
should not use===
to check if the field has changed.Any thoughts?
Details
The text was updated successfully, but these errors were encountered: