Grav\Plugin\Admin\Popularity::getWeeklyTotal PHP Method

getWeeklyTotal() public method

public getWeeklyTotal ( ) : integer
return integer
    public function getWeeklyTotal()
    {
        if (!$this->daily_data) {
            $this->daily_data = $this->getData($this->daily_file);
        }
        $day = 0;
        $total = 0;
        foreach (array_reverse($this->daily_data) as $daily) {
            $total += $daily;
            $day++;
            if ($day == 7) {
                break;
            }
        }
        return $total;
    }