Ported to latest doctrine-module.