copied all from CyclearCQParserBundle