Knp\Bundle\KnpBundlesBundle\Repository\ScoreRepository::getEvolutionCounts PHP Method

getEvolutionCounts() public method

Get an array containing dates and number of scores for this date
public getEvolutionCounts ( $period = 50 ) : array
return array
    public function getEvolutionCounts($period = 50)
    {
        return $this->createQueryBuilder('s')->select('s.date, COUNT(s.id) AS value')->where('s.date > :period')->groupBy('s.date')->orderBy('s.date', 'asc')->setParameter('period', new \DateTime(sprintf('%d days ago', $period)))->getQuery()->execute();
    }