Support for Doctrine 1.2, closes #1121