获得“第0行,第19行:错误:预期的已知函数,从'Doctrine获得'MONTH'”错误以获取以下查询:
return $this->getEntityManager()
->createQuery("SELECT tp.id as id,MONTH(tp.dia) as mes,tp.tema as tema, tp.dia as dia, tu.nome as turma FROM AppBundle:TempoProfessor tp, AppBundle:Horario h, AppBundle:Turma tu WHERE tp.horario = h.id AND tu.id = h.turma AND tu.anoLectivo =:ano AND h.professor=:professor GROUP BY mes")
->setParameter('professor', $professor)
->setParameter('ano', $ano)
->getResult();