Skip to content

Commit dc76fea

Browse files
committed
fix objectToArray()
1 parent d0023b1 commit dc76fea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

system/Database/BaseBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Closure;
1515
use CodeIgniter\Database\Exceptions\DatabaseException;
1616
use CodeIgniter\Database\Exceptions\DataException;
17+
use CodeIgniter\Database\RawSql;
1718
use InvalidArgumentException;
1819

1920
/**
@@ -2698,7 +2699,7 @@ protected function objectToArray($object)
26982699

26992700
foreach (get_object_vars($object) as $key => $val) {
27002701
// There are some built in keys we need to ignore for this conversion
2701-
if (! is_object($val) && ! is_array($val) && $key !== '_parent_name') {
2702+
if ((! is_object($val) && ! is_array($val) && $key !== '_parent_name') || is_a($val, RawSql::class)) {
27022703
$array[$key] = $val;
27032704
}
27042705
}

0 commit comments

Comments
 (0)