Open eastern-ravindra opened 6 months ago
If you take out the assertion, does it work? There is this line too that expects the target: https://github.com/doctrine/doctrine-laminas-hydrator/blob/81ee8121f42dcc0b6f39e08dce56b10baf6fb95f/src/DoctrineObject.php#L373
If you take out the assertion, does it work? There is this line too that expects the target:
toMany
function is not working in this case, giving
Doctrine\Persistence\Mapping\MappingExceptionClass '' does not exist
I think, we need to override this function where we can add conditions if $target
is null
https://github.com/doctrine/doctrine-laminas-hydrator/blame/81ee8121f42dcc0b6f39e08dce56b10baf6fb95f/src/DoctrineObject.php#L355
Above assert code is failing for mongoDB, when we are using EmbedMany argument without target document locally.
According to documentation, EmbedMany without target document is allowed to embed different documents in same field.(https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/2.7/reference/embedded-mapping.html#mixing-document-types)
Does this
assert
check is really needed asnull
value is also accepted for mongodb?