Ver código fonte

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

thewilkybarkid 12 anos atrás
pai
commit
eac11d30f4
1 arquivos alterados com 3 adições e 1 exclusões
  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;