Skip to content

Commit

Permalink
Merge pull request #58 from Recras/setrelated-null
Browse files Browse the repository at this point in the history
Don't consider null-ish changes as dirty
  • Loading branch information
timmipetit authored Jun 7, 2024
2 parents 80db9c6 + e591c54 commit c1f7f07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Doctrine/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,12 @@ protected function _isValueModified($type, $old, $new)
return true;
}

if ($old === null && $new === self::$_null) {
return false;
}
if ($new === null && $old === self::$_null) {
return false;
}
if ($type == 'boolean' && (is_bool($old) || is_numeric($old)) && (is_bool($new) || is_numeric($new)) && $old == $new) {
return false;
} else if (in_array($type, array('decimal', 'float')) && is_numeric($old) && is_numeric($new)) {
Expand Down

0 comments on commit c1f7f07

Please sign in to comment.