-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
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
Assert function failing for Mongo ODM EmbedMany tag #84
Comments
If you take out the assertion, does it work? There is this line too that expects the target:
|
I think, we need to override this function where we can add conditions if |
The code you are refering to is in the hydration section, i.e. at the place where an array-like input is converted into an object. To convert something into an object, you need to know that type of object (i.e. what class) it shall be. In case of I am wondering what you expect from this library. How would you like the hydration result to look like? If not even Doctrine knows the type the object should become, how should this library know? One could think of a workaround, the the data is hydrated into a |
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: