Fixing incorrect usage of the Doctrine ODM query object