You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not find a way to make a reference-many association indexed by a specific field or it's node name. In the Doctrine ORM there is something like the indexBy mapping, that you can use to get an associative collection. Is support for this in PHPCR ODM something that might happen?
We could achieve this by adding the appropriate code to the ReferenceManyCollection::initialize method.
The text was updated successfully, but these errors were encountered:
sounds like a useful feature. however, what happens if the index is not unique? using the full path of the target documents would be unique. the node name can not be guaranteed to be unique, and neither a field of a document.
Well I used that branch to fix the issue for me for now, making a PR was by accident. But if you like it I can reopen it.
The reason I only wanted the node name to be the index is because I am using the translations system from the ResourceBundle of Sylius. They require that the collection is indexed by it's locale. I wanted to avoid a different translation strategy for PHPCR documents and make it work the same way as translations do for ORM entities.
I am curious how a node name can be not unique in the same parent document? I have never been able to make a node at the same parent with the same name.
I could not find a way to make a
reference-many
association indexed by a specific field or it's node name. In the Doctrine ORM there is something like theindexBy
mapping, that you can use to get an associative collection. Is support for this in PHPCR ODM something that might happen?We could achieve this by adding the appropriate code to the
ReferenceManyCollection::initialize
method.The text was updated successfully, but these errors were encountered: