It's done in https://github.com/doctrine/DoctrineORMModule/pull/199/files#diff-3e5d641dde54b684e6be12a43b43638dR584