Potential problem here: `getUnitOfWork()` is not in the interface `Doctrine\Common\Persistence\ObjectManager`, but happens to be in the class we're using, `Doctrine\ODM\PHPCR\DocumentManager`. So, the manager registry could potentially return an incompatible ObjectManager.