moved common Doctrine functions into a dedicated package