Skip to content

Commit 122f73b

Browse files
committed
refactor: remove if condition
1 parent 78c9326 commit 122f73b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

system/Model.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -812,19 +812,16 @@ protected function objectToRawArray($object, bool $onlyChanged = true, bool $rec
812812

813813
// Restore Entity casting setting.
814814
$object->cast($cast);
815-
}
816815

817-
// Always grab the primary key otherwise updates will fail.
818-
if (
819-
$object instanceof Entity
820-
&& (
816+
// Always grab the primary key otherwise updates will fail.
817+
if (
821818
! empty($properties)
822819
&& ! empty($this->primaryKey)
823820
&& ! in_array($this->primaryKey, $properties, true)
824821
&& ! empty($primaryKey)
825-
)
826-
) {
827-
$properties[$this->primaryKey] = $primaryKey;
822+
) {
823+
$properties[$this->primaryKey] = $primaryKey;
824+
}
828825
}
829826

830827
return $properties;

0 commit comments

Comments
 (0)