浏览代码

Create hash from the DateTime value rather than the object itself. Fixes #455

thewilkybarkid 12 年之前
父节点
当前提交
eac11d30f4
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lib/Gedmo/Sortable/SortableListener.php

+ 3 - 1
lib/Gedmo/Sortable/SortableListener.php

@@ -356,7 +356,9 @@ class SortableListener extends MappedEventSubscriber
     {
         $data = $config['useObjectClass'];
         foreach ($groups as $group => $val) {
-            if (is_object($val)) {
+            if($val instanceof \DateTime) {
+                $val = $val->format('c');
+            } elseif (is_object($val)) {
                 $val = spl_object_hash($val);
             }
             $data .= $group.$val;