doctrine / phpcr-odm

Doctrine PHPCR ODM
http://www.doctrine-project.org/projects/phpcr-odm.html
MIT License
183 stars 97 forks source link

Nodenames in Children collection with filter #447

Open dbu opened 10 years ago

dbu commented 10 years ago

in #446 i add validation on the Child mapping so that you can't misuse that field to persist a document that is not attached to that field.

we could do the same in the Children, check the name with the filter that is set on the mapping and refuse a name that does not match. could save quite some confusion when somebody is getting it wrong.

whats more, related to #358 we could integrate with autoname strategy by passing along a name hint that will match the filter. so for example if my filter is block* the namehint would be "block" so that i can actually use children and autoname documents together. this is a special case anyways, so i guess checking what type of id generator this is and call a specific method should be ok, do you agree? at the same time i would love to fix #358 and define precedence if both the document and the children mapping indicate a name hint. i think the children collection hint should win in that case, over the hint on the id. (its more sane to have hints from the children mapping than fixed on a document class anyways i think)

dbu commented 10 years ago

okay, this really aught to be 1.2, we have to stop at some point. lets first get 1.1 out before further discussing this one.

dbu commented 10 years ago

removed the milestone