Skip to content

Commit da16a41

Browse files
committed
fix: enable cast only when $_cast is true in __set()
1 parent 9dc49af commit da16a41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

system/Entity/Entity.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,9 @@ public function __set(string $key, $value = null)
568568
$value = $this->mutateDate($value);
569569
}
570570

571-
$value = $this->castAs($value, $dbColumn, 'set');
571+
if ($this->_cast) {
572+
$value = $this->castAs($value, $dbColumn, 'set');
573+
}
572574

573575
// if a setter method exists for this key, use that method to
574576
// insert this value. should be outside $isNullable check,

0 commit comments

Comments
 (0)