Fix loading references if mapped by uuid and not by id. #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DocumentManager::getReference() does not work correctly if called with an uuid instead of an id,
so if we have an uuid here, we have to fetch the node first (which unfortunately is not optimal
from a performance point of view) to get the correct id of the document.
(DocumentManager::getReference() seems to work first - but it will initialize the id field with the
uuid and this will cause errors later, e.g. when accessing other referenced documents of the loaded
document - it is simply not possible to use it correctly with an uuid)
Am I right?
Is there a correct way to get a proxy class for a document when you only know the uuid and not the id? Unfortunately I could not find a way to do it. (I am using jackalope-doctrine-dbal)
Let's check and discuss if there is a better solution. :-)