original_string: protected function archiveDayEntryActions($rankingQueryLimit)
      {
          $rankingQuery = false;
          if ($rankingQueryLimit > 0) {
              $rankingQuery = new RankingQuery($rankingQueryLimit);
              $rankingQuery->setOthersLabel(DataTable::LABEL_SUMMARY_ROW);
              $rankingQuery->addLabelColumn('idaction');
              $rankingQuery->addColumn(PiwikMetrics::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS);
              $rankingQuery->addColumn(array(PiwikMetrics::INDEX_PAGE_ENTRY_NB_VISITS,
                                             PiwikMetrics::INDEX_PAGE_ENTRY_NB_ACTIONS,
                                             PiwikMetrics::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH,
                                             PiwikMetrics::INDEX_PAGE_ENTRY_BOUNCE_COUNT), 'sum');
              $rankingQuery->partitionResultIntoMultipleGroups('type', array_keys($this->actionsTablesByType));
  
              $extraSelects = 'log_action.type, log_action.name,';
              $from = array(
                  "log_visit",
                  array(
                      "table"  => "log_action",
                      "joinOn" => "log_visit.%s = log_action.idaction"
                  )
              );
              $orderBy = "`" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_ACTIONS . "` DESC, log_action.name ASC";
          } else {
              $extraSelects = false;
              $from = "log_visit";
              $orderBy = false;
          }
  
          $select = "log_visit.%s as idaction, $extraSelects
                  count(distinct log_visit.idvisitor) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS . "`,
                  count(*) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_VISITS . "`,
                  sum(log_visit.visit_total_actions) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_ACTIONS . "`,
                  sum(log_visit.visit_total_time) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH . "`,
                  sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_BOUNCE_COUNT . "`";
  
          $where  = $this->getLogAggregator()->getWhereStatement('log_visit', 'visit_last_action_time');
          $where .= " AND log_visit.%s > 0";
  
          $groupBy = "log_visit.%s";
  
          $this->archiveDayQueryProcess($select, $from, $where, $groupBy, $orderBy, "visit_entry_idaction_url", $rankingQuery);
  
          $this->archiveDayQueryProcess($select, $from, $where, $groupBy, $orderBy, "visit_entry_idaction_name", $rankingQuery);
      }
code: protected function archiveDayEntryActions($rankingQueryLimit)
      {
          $rankingQuery = false;
          if ($rankingQueryLimit > 0) {
              $rankingQuery = new RankingQuery($rankingQueryLimit);
              $rankingQuery->setOthersLabel(DataTable::LABEL_SUMMARY_ROW);
              $rankingQuery->addLabelColumn('idaction');
              $rankingQuery->addColumn(PiwikMetrics::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS);
              $rankingQuery->addColumn(array(PiwikMetrics::INDEX_PAGE_ENTRY_NB_VISITS,
                                             PiwikMetrics::INDEX_PAGE_ENTRY_NB_ACTIONS,
                                             PiwikMetrics::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH,
                                             PiwikMetrics::INDEX_PAGE_ENTRY_BOUNCE_COUNT), 'sum');
              $rankingQuery->partitionResultIntoMultipleGroups('type', array_keys($this->actionsTablesByType));
  
              $extraSelects = 'log_action.type, log_action.name,';
              $from = array(
                  "log_visit",
                  array(
                      "table"  => "log_action",
                      "joinOn" => "log_visit.%s = log_action.idaction"
                  )
              );
              $orderBy = "`" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_ACTIONS . "` DESC, log_action.name ASC";
          } else {
              $extraSelects = false;
              $from = "log_visit";
              $orderBy = false;
          }
  
          $select = "log_visit.%s as idaction, $extraSelects
                  count(distinct log_visit.idvisitor) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS . "`,
                  count(*) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_VISITS . "`,
                  sum(log_visit.visit_total_actions) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_NB_ACTIONS . "`,
                  sum(log_visit.visit_total_time) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH . "`,
                  sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_BOUNCE_COUNT . "`";
  
          $where  = $this->getLogAggregator()->getWhereStatement('log_visit', 'visit_last_action_time');
          $where .= " AND log_visit.%s > 0";
  
          $groupBy = "log_visit.%s";
  
          $this->archiveDayQueryProcess($select, $from, $where, $groupBy, $orderBy, "visit_entry_idaction_url", $rankingQuery);
  
          $this->archiveDayQueryProcess($select, $from, $where, $groupBy, $orderBy, "visit_entry_idaction_name", $rankingQuery);
      }
code_tokens: protected function archiveDayEntryActions ( $ rankingQueryLimit ) { $ rankingQuery = false ; if ( $ rankingQueryLimit > 0 ) { $ rankingQuery = new RankingQuery ( $ rankingQueryLimit ) ; $ rankingQuery -> setOthersLabel ( DataTable :: LABEL_SUMMARY_ROW ) ; $ rankingQuery -> addLabelColumn ( 'idaction' ) ; $ rankingQuery -> addColumn ( PiwikMetrics :: INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS ) ; $ rankingQuery -> addColumn ( array ( PiwikMetrics :: INDEX_PAGE_ENTRY_NB_VISITS , PiwikMetrics :: INDEX_PAGE_ENTRY_NB_ACTIONS , PiwikMetrics :: INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH , PiwikMetrics :: INDEX_PAGE_ENTRY_BOUNCE_COUNT ) , 'sum' ) ; $ rankingQuery -> partitionResultIntoMultipleGroups ( 'type' , array_keys ( $ this -> actionsTablesByType ) ) ; $ extraSelects = 'log_action.type, log_action.name,' ; $ from = array ( "log_visit" , array ( "table" => "log_action" , "joinOn" => "log_visit.%s = log_action.idaction" ) ) ; $ orderBy = "`" . PiwikMetrics :: INDEX_PAGE_ENTRY_NB_ACTIONS . "` DESC, log_action.name ASC" ; } else { $ extraSelects = false ; $ from = "log_visit" ; $ orderBy = false ; } $ select = "log_visit.%s as idaction, $extraSelects
                  count(distinct log_visit.idvisitor) as `" . PiwikMetrics :: INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS . "`,
                  count(*) as `" . PiwikMetrics :: INDEX_PAGE_ENTRY_NB_VISITS . "`,
                  sum(log_visit.visit_total_actions) as `" . PiwikMetrics :: INDEX_PAGE_ENTRY_NB_ACTIONS . "`,
                  sum(log_visit.visit_total_time) as `" . PiwikMetrics :: INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH . "`,
                  sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) as `" . PiwikMetrics :: INDEX_PAGE_ENTRY_BOUNCE_COUNT . "`" ; $ where = $ this -> getLogAggregator ( ) -> getWhereStatement ( 'log_visit' , 'visit_last_action_time' ) ; $ where .= " AND log_visit.%s > 0" ; $ groupBy = "log_visit.%s" ; $ this -> archiveDayQueryProcess ( $ select , $ from , $ where , $ groupBy , $ orderBy , "visit_entry_idaction_url" , $ rankingQuery ) ; $ this -> archiveDayQueryProcess ( $ select , $ from , $ where , $ groupBy , $ orderBy , "visit_entry_idaction_name" , $ rankingQuery ) ; }
docstring: Entry actions for Page URLs and Page names
docstring_tokens: Entry actions for Page URLs and Page names