Doctrine helpers.