symfonydoctrinejcrdoctrine-odmdoctrine-phpcr

PHPCR ODM - get path of not-persisted document


I'm trying to determine the 'future' path a document will get in Doctrine PHPCR ODM, but I don't know how to do this. I can't find any clear documentation on this either...

Can someone help me out on determining the path a document/node will be stored in?


Solution

  • My bad, I was using the wrong order...

    You can find out the path of a document by setting the parent first using Document::setParent() and putting all listeners / validators / whatever after that with Document::getParent()::getId().