Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Minor refactorings + fix for dbo mysqli related to previous commit
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8261 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
DarkAngelBGE committed Jul 28, 2009
1 parent f88cc56 commit f710ae7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cake/libs/model/datasources/dbo/dbo_mysqli.php
Expand Up @@ -204,19 +204,22 @@ function value($data, $column = null, $safe = false) {
return 'NULL';
}
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
return "''";
return "''";
}
if (empty($column)) {
$column = $this->introspectType($data);
}

switch ($column) {
case 'boolean':
$data = $this->boolean((bool)$data);
return $this->boolean((bool)$data);
break;
case 'integer' :
case 'float' :
case null :
if ($data === '') {
return 'NULL';
}
if ((is_int($data) || is_float($data) || $data === '0') || (
is_numeric($data) && strpos($data, ',') === false &&
$data[0] != '0' && strpos($data, 'e') === false)) {
Expand Down

0 comments on commit f710ae7

Please sign in to comment.