We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/doctrine/doctrine-laminas-hydrator/blame/81ee8121f42dcc0b6f39e08dce56b10baf6fb95f/src/DoctrineObject.php#L355
if ($metadata->hasAssociation($field)) { $target = $metadata->getAssociationTargetClass($field); assert($target !== null);
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 as null value is also accepted for mongodb?
assert
null
The text was updated successfully, but these errors were encountered:
If you take out the assertion, does it work? There is this line too that expects the target:
doctrine-laminas-hydrator/src/DoctrineObject.php
Line 373 in 81ee812
Sorry, something went wrong.
If you take out the assertion, does it work? There is this line too that expects the target: doctrine-laminas-hydrator/src/DoctrineObject.php Line 373 in 81ee812 $this->toMany($object, $field, $target, $value);
toMany function is not working in this case, giving
toMany
Doctrine\Persistence\Mapping\MappingExceptionClass '' does not exist
I think, we need to override this function where we can add conditions if $target is null
$target
No branches or pull requests
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?The text was updated successfully, but these errors were encountered: