Browse Source

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

thewilkybarkid 12 years ago
parent
commit
eac11d30f4
1 changed files with 3 additions and 1 deletions
  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'];
         $data = $config['useObjectClass'];
         foreach ($groups as $group => $val) {
         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);
                 $val = spl_object_hash($val);
             }
             }
             $data .= $group.$val;
             $data .= $group.$val;