https://github.com/Kdyby/Doctrine/pull/54#r7788400