original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: Sets the number of total visits in tha pastTable on the dataTable as metadata.
  
  @param DataTable $dataTable
  @param DataTable $pastTable
docstring_tokens: Sets the number of total visits in tha pastTable on the dataTable as metadata .