can't you drop having $dm as member variable completely and just use a local variable. feels flacky this way.

and maybe have a getDocumentManager($name = null) that you call to get the document manager where you need it, to avoid the initialization problem