[pLog-svn] r3342 - plog/trunk/class/dao
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Fri May 5 20:35:36 GMT 2006
Author: oscar
Date: 2006-05-05 20:35:35 +0000 (Fri, 05 May 2006)
New Revision: 3342
Modified:
plog/trunk/class/dao/model.class.php
Log:
Timestamp fields were not being properly converted into something meaningful for mysql's timestamp fields, but I wonder how come we never detected this issue before...
Modified: plog/trunk/class/dao/model.class.php
===================================================================
--- plog/trunk/class/dao/model.class.php 2006-05-05 08:11:31 UTC (rev 3341)
+++ plog/trunk/class/dao/model.class.php 2006-05-05 20:35:35 UTC (rev 3342)
@@ -379,11 +379,15 @@
$fieldsString .= $field.", ";
$value = $dbObject->$getter();
+
if( is_array( $value )) $value = serialize( $value );
elseif( is_bool( $value )) $value = (int)$value; // convert the bool to '1' or '0'
- elseif( is_object( $value )) $value = serialize( $value );
- elseif( strtolower(get_class( $value )) == "timestamp" )
- $value = $value->getTimestamp();
+ elseif( is_object( $value )) {
+ if( strtolower(get_class( $value )) == "timestamp" )
+ $value = $value->getTimestamp();
+ else
+ $value = serialize( $value );
+ }
$value = Db::qstr($value);
$fieldsValuesString .= "'" . $value . "', ";
}
More information about the pLog-svn
mailing list