phpcr-odm icon indicating copy to clipboard operation
phpcr-odm copied to clipboard

[WIP] Add mapping to index reference collection by node name

Open koemeet opened this issue 8 years ago • 5 comments

Fixes #701

  • [ ] Implement annotations and YAML driver
  • [ ] Restrict it only to only reference-many collections?

koemeet avatar Apr 18 '16 01:04 koemeet

@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?

koemeet avatar Apr 18 '16 16:04 koemeet

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.

dbu avatar Apr 19 '16 06:04 dbu

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 ?

dbu avatar Jun 20 '16 12:06 dbu

@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 avatar Jan 17 '17 07:01 dbu

@dbu Nice! I will take a look at it and implement it to index by path, seems indeed a better approach.

koemeet avatar Jan 17 '17 08:01 koemeet