private function setPastTotalVisitsMetadata($dataTable, $pastTable)
    {
        if ($pastTable instanceof DataTable) {
            $total  = 0;
            $metric = 'nb_visits';

            $rows = $pastTable->getRows();
            $rows = $this->filterRowsForTotalsCalculation($rows);

            foreach ($rows as $row) {
                $total += $row->getColumn($metric);
            }

            $dataTable->setMetadata(self::getTotalMetadataName($metric . '_lastdate'), $total);
        }
    }
private function setPastTotalVisitsMetadata($dataTable, $pastTable)
    {
        if ($pastTable instanceof DataTable) {
            $total  = 0;
            $metric = 'nb_visits';

            $rows = $pastTable->getRows();
            $rows = $this->filterRowsForTotalsCalculation($rows);

            foreach ($rows as $row) {
                $total += $row->getColumn($metric);
            }

            $dataTable->setMetadata(self::getTotalMetadataName($metric . '_lastdate'), $total);
        }
    }
private function setPastTotalVisitsMetadata ( $ dataTable , $ pastTable ) { if ( $ pastTable instanceof DataTable ) { $ total = 0 ; $ metric = 'nb_visits' ; $ rows = $ pastTable -> getRows ( ) ; $ rows = $ this -> filterRowsForTotalsCalculation ( $ rows ) ; foreach ( $ rows as $ row ) { $ total += $ row -> getColumn ( $ metric ) ; } $ dataTable -> setMetadata ( self :: getTotalMetadataName ( $ metric . '_lastdate' ) , $ total ) ; } }
Sets the number of total visits in tha pastTable on the dataTable as metadata.

@param DataTable $dataTable
@param DataTable $pastTable
Sets the number of total visits in tha pastTable on the dataTable as metadata .