Skip to content
This repository
Browse code

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...
commit f710ae7fbe7837d4401cca1a95395ae7c729929d 1 parent f88cc56
Tim Koschuetzki authored July 28, 2009
7  cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -204,7 +204,7 @@ function value($data, $column = null, $safe = false) {
204 204
 			return 'NULL';
205 205
 		}
206 206
 		if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
207  
-			return  "''";
  207
+			return "''";
208 208
 		}
209 209
 		if (empty($column)) {
210 210
 			$column = $this->introspectType($data);
@@ -212,11 +212,14 @@ function value($data, $column = null, $safe = false) {
212 212
 
213 213
 		switch ($column) {
214 214
 			case 'boolean':
215  
-				$data = $this->boolean((bool)$data);
  215
+				return $this->boolean((bool)$data);
216 216
 			break;
217 217
 			case 'integer' :
218 218
 			case 'float' :
219 219
 			case null :
  220
+				if ($data === '') {
  221
+					return 'NULL';
  222
+				}
220 223
 				if ((is_int($data) || is_float($data) || $data === '0') || (
221 224
 					is_numeric($data) && strpos($data, ',') === false &&
222 225
 					$data[0] != '0' && strpos($data, 'e') === false)) {

0 notes on commit f710ae7

Please sign in to comment.
Something went wrong with that request. Please try again.