mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Changes to make sqlite recognize boolean columns declared as "boolean", so they can be casted to native php type
This commit is contained in:
parent
1d530db39b
commit
fe18e31b79
1 changed files with 10 additions and 2 deletions
|
@ -308,11 +308,19 @@ class DboSqlite extends DboSource {
|
|||
$columnName = str_ireplace('DISTINCT', '', $columnName);
|
||||
}
|
||||
|
||||
$metaType = false;
|
||||
try {
|
||||
$metaData = (array)$results->getColumnMeta($j);
|
||||
if (!empty($metaData['sqlite:decl_type'])) {
|
||||
$metaType = trim($metaData['sqlite:decl_type']);
|
||||
}
|
||||
} catch (Exception $e) {}
|
||||
|
||||
if (strpos($columnName, '.')) {
|
||||
$parts = explode('.', $columnName);
|
||||
$this->map[$index++] = array(trim($parts[0]), trim($parts[1]));
|
||||
$this->map[$index++] = array(trim($parts[0]), trim($parts[1]), $metaType);
|
||||
} else {
|
||||
$this->map[$index++] = array(0, $columnName);
|
||||
$this->map[$index++] = array(0, $columnName, $metaType);
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue