doctrine / doctrine/phpcr-odm

Nodenames in Children collection with filter

Open
#447 2 comments 0 reactions 0 assignees View on GitHub
sanity checks
Dominant language
PHP
Stars
181
Forks
102
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.