-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
[WIP] Add mapping to index reference collection by node name #702
base: 2.x
Are you sure you want to change the base?
Conversation
… associative indexes based on the reference node name.
index-by-nodename
XML mapping, so you can make a reference have…
@dbu So, for a |
for the ReferenceManyCollection, i am not sure if we can do the associative by name at all, because of the risk of name collisions. maybe we should use the full path instead of the name for the reference many collection. children are handled with the ChildrenCollection. for children collection, i agree that having them associative would be a good idea. i think we should have the configuration option for now, but tell that in version 2 we will only have associative children and remove the option again. there is a risk of unexpected behaviour when the keys change. |
$referencedDocs[] = $proxy; | ||
if ($isAssociative) { | ||
$index = $referencedNode->getName(); | ||
$referencedDocs[$index] = $proxy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might overwrite other referenced documents with the same node name. we should use $referenceNode->getPath() i think.
i just started with a 2.0 branch. maybe this should be done against 2.0 so we need not worry about unexpected BC troubles because of slightly different behaviour. wdyt @steffenbrem ? |
@steffenbrem do you want to wrap this up for 2.0? i think we need to index by path instead of by nodename, to avoid problems with name collisions. |
@dbu Nice! I will take a look at it and implement it to index by path, seems indeed a better approach. |
Fixes #701
reference-many
collections?