Closed
Description
I have a @ReferenceMany
defined like this:
/**
* @MongoDB\ReferenceMany(mappedBy="post")
*/
protected $activity;
This works great until I try to serialize the object (using JMSSerializerBundle
) as the MongoDB ODM throws the following error:
Warning: class_parents() [function.class-parents]: object or string expected in ...\doctrine-mongodb-odm\lib\Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory.php line 336
Following the stack trace leads me to line 693 of DocumentPersister.php:
$targetClass = $this->dm->getClassMetadata($mapping['targetDocument']);
$mapping['targetDocument']
in this instance is null
.