-
Notifications
You must be signed in to change notification settings - Fork 1
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
EmbedMany #54
Comments
The preLoadSubscriber is there so that access control gets honoured for embedded documents. Here's what needs to be done. When using a discriminator map, target document isn't set, which is why the code is failing. Need to add a new
:) |
Thanks for the advice 👍 I wasn't entirely sure how to approach the |
Actually, I just realised I made a mistake. Try this:
Or the long version of the important bit:
|
Unfortunately it's a little more complicated than that. If you have something like: /**
* @ODM\EmbedMany(
* discriminatorMap={
* "Artist"="Artist",
* "SongWriter"="SongWriter"
* }
* )
*/
protected $songWriters = []; I think we need to loop through each item within the field and check against it's I'm going to submit a PR soon. It's a little messy so I'd like to get your thoughts. |
Currently
EmbedMany
fails using adiscriminatorMap
here: https://github.com/zoopcommerce/shard/blob/master/lib/Zoop/Shard/ODMCore/PreLoadSubscriber.php#L55See doctrine docs for allowed attributes: http://doctrine-mongodb-odm.readthedocs.org/en/latest/reference/annotations-reference.html#embedmany
The text was updated successfully, but these errors were encountered: