original_string: protected function aggregateByPlugin()
      {
          $selects = array();
          $columns = DevicePlugins::getAllPluginColumns();
  
          foreach ($columns as $column) {
              $selects[] = sprintf(
                  "sum(case log_visit.%s when 1 then 1 else 0 end) as %s",
                  $column->getColumnName(),
                  substr($column->getColumnName(), 7) // remove leading `config_`
              );
          }
  
          $query = $this->getLogAggregator()->queryVisitsByDimension(array(), false, $selects, $metrics = array());
          $data = $query->fetch();
          $cleanRow = LogAggregator::makeArrayOneColumn($data, Metrics::INDEX_NB_VISITS);
          $table = DataTable::makeFromIndexedArray($cleanRow);
          $this->insertTable(self::PLUGIN_RECORD_NAME, $table);
      }
code: protected function aggregateByPlugin()
      {
          $selects = array();
          $columns = DevicePlugins::getAllPluginColumns();
  
          foreach ($columns as $column) {
              $selects[] = sprintf(
                  "sum(case log_visit.%s when 1 then 1 else 0 end) as %s",
                  $column->getColumnName(),
                  substr($column->getColumnName(), 7) // remove leading `config_`
              );
          }
  
          $query = $this->getLogAggregator()->queryVisitsByDimension(array(), false, $selects, $metrics = array());
          $data = $query->fetch();
          $cleanRow = LogAggregator::makeArrayOneColumn($data, Metrics::INDEX_NB_VISITS);
          $table = DataTable::makeFromIndexedArray($cleanRow);
          $this->insertTable(self::PLUGIN_RECORD_NAME, $table);
      }
code_tokens: protected function aggregateByPlugin ( ) { $ selects = array ( ) ; $ columns = DevicePlugins :: getAllPluginColumns ( ) ; foreach ( $ columns as $ column ) { $ selects [ ] = sprintf ( "sum(case log_visit.%s when 1 then 1 else 0 end) as %s" , $ column -> getColumnName ( ) , substr ( $ column -> getColumnName ( ) , 7 ) // remove leading `config_` ) ; } $ query = $ this -> getLogAggregator ( ) -> queryVisitsByDimension ( array ( ) , false , $ selects , $ metrics = array ( ) ) ; $ data = $ query -> fetch ( ) ; $ cleanRow = LogAggregator :: makeArrayOneColumn ( $ data , Metrics :: INDEX_NB_VISITS ) ; $ table = DataTable :: makeFromIndexedArray ( $ cleanRow ) ; $ this -> insertTable ( self :: PLUGIN_RECORD_NAME , $ table ) ; }
docstring: Archives reports for all available plugin columns
  @see DevicePluginColumn
docstring_tokens: Archives reports for all available plugin columns