We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7da9451 commit ae50416Copy full SHA for ae50416
Mapper/FieldFilter/ArrayObjectMappingFilter.php
@@ -2,6 +2,8 @@
2
3
namespace BCC\AutoMapperBundle\Mapper\FieldFilter;
4
5
+use Doctrine\Common\Collections\Collection;
6
+
7
/**
8
* Filter array object value and map inner items to given className
9
*
@@ -19,6 +21,10 @@ class ArrayObjectMappingFilter extends AbstractMappingFilter
19
21
*/
20
22
function filter($value)
23
{
24
+ if ($value instanceof Collection) {
25
+ $value = $value->toArray();
26
+ }
27
28
if (is_array($value)) {
29
$objectFilter = new ObjectMappingFilter($this->className);
30
$objectFilter->setMapper($this->getMapper());
@@ -28,4 +34,4 @@ function filter($value)
34
}, $value);
35
}
36
31
-}
37
+}
0 commit comments