From 82fe64c368e6e3f6c1d77ab1857904970ae6ffa8 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Wed, 1 May 2024 09:38:19 -0500 Subject: [PATCH] Don't check for boolean columsn in DbConnetion --- lib/DbConnection.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/DbConnection.php b/lib/DbConnection.php index f2e91469..6583efbc 100644 --- a/lib/DbConnection.php +++ b/lib/DbConnection.php @@ -162,11 +162,6 @@ class DbConnection{ for($i = 0; $i < $columnCount; $i++){ $metadata[$i] = $handle->getColumnMeta($i); - if($metadata[$i] && preg_match('/^(Is|Has|Can)[A-Z]/u', $metadata[$i]['name']) === 1){ - // MySQL doesn't have a native boolean type, so fake it here if the column - // name starts with Is, Has, or Can and is followed by an uppercase letter - $metadata[$i]['native_type'] = 'BOOL'; - } } $rows = $handle->fetchAll(\PDO::FETCH_NUM); @@ -209,10 +204,6 @@ class DbConnection{ $object->{$metadata[$i]['name']} = floatval($row[$i]); break; - case 'BOOL': - $object->{$metadata[$i]['name']} = $row[$i] == 1 ? true : false; - break; - case 'STRING': // We don't check the type VAR_STRING here because in MariaDB, enums are always of type STRING. // Since this check is slow, we don't want to run it unnecessarily.