mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 10:02:02 -04:00
Don't check for boolean columsn in DbConnetion
This commit is contained in:
parent
97cafbf128
commit
82fe64c368
1 changed files with 0 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue