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
I've found an issue where i have a Contact that is being returned with a null last name.
If i write $contact->setLastName(null) it marks it as dirty even though the values are the same. The function at the bottom is the problem.
Would it be feasible to change this to allow it to compare the value more accurately? I'm happy to do the PR, just want the feedback before i do the work
protected function propertyUpdated($property, $value)
{
if (! isset($this->_data[$property]) || $this->_data[$property] !== $value) {
//If this object can update itself, set its own dirty flag, otherwise, set its parent's.
if (count(array_intersect($this::getSupportedMethods(), [Request::METHOD_PUT, Request::METHOD_POST])) > 0) {
//Object can update itself
$this->setDirty($property);
} else {
//Object can't update itself, so tell its parents
foreach ($this->_associated_objects as $parent_property => $object) {
$object->setDirty($parent_property);
}
}
}
}
The text was updated successfully, but these errors were encountered:
I've found an issue where i have a Contact that is being returned with a null last name.
If i write $contact->setLastName(null) it marks it as dirty even though the values are the same. The function at the bottom is the problem.
Would it be feasible to change this to allow it to compare the value more accurately? I'm happy to do the PR, just want the feedback before i do the work
something like
Original Function
The text was updated successfully, but these errors were encountered: