Browse Source

Fix doctrine persistent collections not serializing

The problem was that the collection handler was only dealing with ArrayCollection
Baldur Rensch 12 năm trước cách đây
mục cha
commit
f236e2e03c
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Serializer/Handler/ArrayCollectionHandler.php

+ 1 - 1
Serializer/Handler/ArrayCollectionHandler.php

@@ -17,7 +17,7 @@ class ArrayCollectionHandler implements SubscribingHandlerInterface
     {
         $methods = array();
         $formats = array('json', 'xml', 'yml');
-        $collectionTypes = array('ArrayCollection', 'Doctrine\Common\Collections\ArrayCollection');
+        $collectionTypes = array('ArrayCollection', 'Doctrine\Common\Collections\ArrayCollection', 'Doctrine\ORM\PersistentCollection');
 
         foreach ($collectionTypes as $type) {
             foreach ($formats as $format) {