phpcr-odm
phpcr-odm copied to clipboard
[WIP] Add mapping to index reference collection by node name
Fixes #701
- [ ] Implement annotations and YAML driver
- [ ] Restrict it only to only
reference-many
collections?
@dbu So, for a reference-many
collection it should be okay to maybe do this behaviour by default? Then we could even get rid of the whole index-by-nodename
mapping. Never worked with the referrers
relations etc. to much, but I think the reference-many
is always unique, right?
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. with references, you can reference arbitrary documents. if you reference /a/b/c and /b/b/c then both local names will be "c".
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.
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.