Don't check for boolean columsn in DbConnetion

This commit is contained in:
Alex Cabal 2024-05-01 09:38:19 -05:00
parent 97cafbf128
commit 82fe64c368

View file

@ -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.