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
Model::hasChanged() always return true if params is array and any field is changed.
I think if send array to model::hasChanged, this method should check that fields in this array has changed.
Something like this
publicfunction hasChanged(var fieldName = null) -> boolean
{
var changedFields;
let changedFields = this->getChangedFields();
/** * If a field was specified we only check it */if typeof fieldName == "string" {
returnin_array(fieldName, changedFields);
} elseif (typeof fieldName == "array") {
foreach (changedFields as field) {
ifin_array(field, changedFields) {
returntrue;
}
}
returnfalse;
}
returncount(changedFields) > 0;
}
Phalcon version: 3.0.4
PHP Version: 7.0.15
Operating System: Win7
The text was updated successfully, but these errors were encountered:
Expected and Actual Behavior
Model::hasChanged() always return true if params is array and any field is changed.
I think if send array to model::hasChanged, this method should check that fields in this array has changed.
Something like this
The text was updated successfully, but these errors were encountered: