mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
Merge pull request #93 from sminnee/fix-boolean-coersion
FIX: Boolean ’t’/‘f’ strings need to be coerced to int properly.
This commit is contained in:
commit
f85b46d047
@ -80,9 +80,13 @@ class PostgreSQLQuery extends Query
|
|||||||
$record[$k] = $v;
|
$record[$k] = $v;
|
||||||
$type = pg_field_type($this->handle, $i);
|
$type = pg_field_type($this->handle, $i);
|
||||||
if (isset(self::$typeMapping[$type])) {
|
if (isset(self::$typeMapping[$type])) {
|
||||||
|
if ($type === 'bool' && $record[$k] === 't') {
|
||||||
|
$record[$k] = 1;
|
||||||
|
} else {
|
||||||
settype($record[$k], self::$typeMapping[$type]);
|
settype($record[$k], self::$typeMapping[$type]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user