cvs: pear /DB_Table/DB Table.php
| From: | Paul Jones | Date: | Mon, 08 Nov 2004 03:22:56 +0000 |
| Subject: | cvs: pear /DB_Table/DB Table.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-25754@lists.php.net to get a copy of this message | ||
pmjones Sun Nov 7 22:22:56 2004 EDT
Modified files:
/pear/DB_Table/DB Table.php
Log:
recast() skips explicit null values instead of recasting them, removed debug printout code
http://cvs.php.net/diff.php/pear/DB_Table/DB/Table.php?r1=1.13&r2=1.14&ty=u
Index: pear/DB_Table/DB/Table.php
diff -u pear/DB_Table/DB/Table.php:1.13 pear/DB_Table/DB/Table.php:1.14
--- pear/DB_Table/DB/Table.php:1.13 Mon Nov 1 19:12:07 2004
+++ pear/DB_Table/DB/Table.php Sun Nov 7 22:22:56 2004
@@ -271,7 +271,7 @@
* and automated creation of QuickForm elemnts based on the column
* definitions.
*
-* $Id: Table.php,v 1.13 2004/11/02 00:12:07 pmjones Exp $
+* $Id: Table.php,v 1.14 2004/11/08 03:22:56 pmjones Exp $
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
@@ -1341,6 +1341,12 @@
unset($val);
$val =& $data[$key];
+ // skip explicit NULL values
+ if (is_null($val)) {
+ continue;
+ }
+
+ // otherwise, recast to the column type
switch ($this->col[$key]['type']) {
case 'boolean':
@@ -1606,16 +1612,12 @@
// have we passed the check so far, and should we
// also check for allowed values?
if ($result && isset($this->col[$col]['qf_vals'])) {
- echo "checking vals for $col";
$keys = array_keys($this->col[$col]['qf_vals']);
- print_r($keys);
$result = in_array(
$val,
array_keys($this->col[$col]['qf_vals'])
);
-
- echo "result was '$result'";
}
return $result;