DbObject: compare id/ints only when not null

This commit is contained in:
Thomas Gelf 2023-07-30 20:05:24 +02:00
parent 2a140a512b
commit 26a4a10536

View File

@ -385,7 +385,10 @@ abstract class DbObject
return $this;
}
if ($key === 'id' || substr($key, -3) === '_id') {
if ((int) $value === (int) $this->properties[$key]) {
if ($value !== null
&& $this->properties[$key] !== null
&& (int) $value === (int) $this->properties[$key]
) {
return $this;
}
}