"referringDocument" and "referencedBy"?
-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.


David Buchmann <notifications@github.com> a écrit :

In lib/Doctrine/ODM/PHPCR/UnitOfWork.php:

> + * reference this document, so we have to update its > + * referencing property to contain the uuid of this > + * document > + */ > + foreach ($fieldValue as $fv) { > + if ($fv === null) { > + continue; > + } > + > + $referencingNode = $this->session->getNode($this->getDocumentId($fv)); > + $referencingMeta = $this->dm->getClassMetadata(get_class($fv)); > + $referencingField = null; > + foreach ($referencingMeta->referenceMappings as $fieldName) { > + $field = $referencingMeta->getAssociation($fieldName); > + > + if ($field['name'] === $mapping['mappedBy']) { 

ok, i think you are right. otherwise we mix the layers completely. targetDocument**s** sounds interesting, but would be weird. what if some of the documents do not use the same phpcr field for the reference? rather have the user create several Referrers annotations. anyways it does not help towards the flexibility of finding referencing documents that this document knows nothing about. i guess for that use case people will just have to go through the DM.
or we could add a phpcrName to MixedReferrers for the use case? would still be readonly but that is good enough. wdyt?

now what to call things? i wonder if targetDocument is right, its the document referencing us, so its rather sourceDocument. would that make sense to you? it would stress the directional nature of references in PHPCR. but its harder to guess for users not familiar with phpcr-odm - but then its required so we can explain in the exception when its missing. 
we can get rid of the weak/hard for Referrers, as that information is in the Reference mapping already.
how do we read the other field? if we request the metadata of the sourceDocument (or targetDocument) in there, we risk endless loops if the other document has a referrer annotation for this document (for example self-referencing). can we handle that once the metadata is already registered with the document manager?

—
Reply to this email directly or view it on GitHub.