It is not a Symfony2 style. Please rewrite it with createQueryBuilder, but if it takes no more than half an hour