why not use the new depthHint parameter to the session directly? https://github.com/phpcr/phpcr/blob/master/src/PHPCR/SessionInterface.php#L302