Create quoted datetime strings of DateTime objects.
authorJan Schneider <jan@horde.org>
Wed, 13 May 2009 23:24:21 +0000 (01:24 +0200)
committerJan Schneider <jan@horde.org>
Wed, 13 May 2009 23:24:39 +0000 (01:24 +0200)
framework/Db/lib/Horde/Db/Adapter/Abstract/Schema.php

index 65352db..b50ac25 100644 (file)
@@ -118,6 +118,10 @@ abstract class Horde_Db_Adapter_Abstract_Schema
               "#{quoted_string_prefix}'#{quote_string(value.to_yaml)}'"
             end
             */
+        } elseif ($value instanceof DateTime) {
+            return $this->_adapter->quoteString($type == 'integer'
+                                                ? $value->format('U')
+                                                : $value->format('Y-m-d H:i:s'));
         } else {
             /*@TODO
           when String, ActiveSupport::Multibyte::Chars