Extensions to doctrine