Changes to make sqlite recognize boolean columns declared as "boolean", so they can be casted to native php type

This commit is contained in:
José Lorenzo Rodríguez 2011-01-01 22:11:28 -04:30
parent 1d530db39b
commit fe18e31b79

View file

@ -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++;
}