From 6bf302feef0d5624c18d6830be2c9a62826ef1e9 Mon Sep 17 00:00:00 2001 From: mattab Date: Wed, 5 Jun 2013 18:13:36 +1200 Subject: Factoring out + cleanup Provider, UserCountry, Goals --- plugins/Transitions/Transitions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/Transitions/Transitions.php') diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php index 4adaf3f997..765854bff7 100644 --- a/plugins/Transitions/Transitions.php +++ b/plugins/Transitions/Transitions.php @@ -118,7 +118,7 @@ class Piwik_Transitions extends Piwik_Plugin foreach ($subData as &$row) { if ($referrerType == Piwik_Common::REFERER_TYPE_SEARCH_ENGINE && empty($row['referrer_data'])) { - $row['referrer_data'] = Piwik_Referers::LABEL_KEYWORD_NOT_DEFINED; + $row['referrer_data'] = Piwik_Referers_API::LABEL_KEYWORD_NOT_DEFINED; } $referrerData[$referrerType][Piwik_Archive::INDEX_NB_VISITS] += $row[Piwik_Archive::INDEX_NB_VISITS]; -- cgit v1.2.3 From c17139710a43b55b5f48377e6281db6ae602957c Mon Sep 17 00:00:00 2001 From: mattab Date: Mon, 10 Jun 2013 21:00:42 +1200 Subject: refactoring / improvements of Archiveprocessing (in progress) such as removing duplicate code and a lot of refactoring, the code is now much more readable! --- plugins/Transitions/Transitions.php | 62 +++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 34 deletions(-) (limited to 'plugins/Transitions/Transitions.php') diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php index 765854bff7..b92ef87b8c 100644 --- a/plugins/Transitions/Transitions.php +++ b/plugins/Transitions/Transitions.php @@ -79,16 +79,15 @@ class Piwik_Transitions extends Piwik_Plugin // group by. when we group by both, we don't get a single column for the keyword but instead // one column per keyword + search engine url. this way, we could not get the top keywords using // the ranking query. - $dimension = 'referrer_data'; + $dimensions = array('referrer_data', 'referer_type'); $rankingQuery->addLabelColumn('referrer_data'); - $select = ' - CASE referer_type + $selects = array( + 'CASE referer_type WHEN ' . Piwik_Common::REFERER_TYPE_DIRECT_ENTRY . ' THEN \'\' WHEN ' . Piwik_Common::REFERER_TYPE_SEARCH_ENGINE . ' THEN referer_keyword WHEN ' . Piwik_Common::REFERER_TYPE_WEBSITE . ' THEN referer_url WHEN ' . Piwik_Common::REFERER_TYPE_CAMPAIGN . ' THEN CONCAT(referer_name, \' \', referer_keyword) - END AS referrer_data, - referer_type'; + END AS referrer_data'); // get one limited group per referrer type $rankingQuery->partitionResultIntoMultipleGroups('referer_type', array( @@ -98,14 +97,11 @@ class Piwik_Transitions extends Piwik_Plugin Piwik_Common::REFERER_TYPE_CAMPAIGN )); - $orderBy = '`' . Piwik_Archive::INDEX_NB_VISITS . '` DESC'; - $type = $this->getColumnTypeSuffix($actionType); $where = 'visit_entry_idaction_' . $type . ' = ' . intval($idaction); $metrics = array(Piwik_Archive::INDEX_NB_VISITS); - $data = $archiveProcessing->queryVisitsByDimension($dimension, $where, $metrics, $orderBy, - $rankingQuery, $select, $selectGeneratesLabelColumn = true); + $data = $archiveProcessing->queryVisitsByDimension($dimensions, $where, $selects, $metrics, $rankingQuery); $referrerData = array(); $referrerSubData = array(); @@ -132,7 +128,9 @@ class Piwik_Transitions extends Piwik_Plugin } } - return $archiveProcessing->getDataTableWithSubtablesFromArraysIndexedByLabel($referrerSubData, $referrerData); + //FIXMEA refactor after integration tests written + $array = new Piwik_DataArray($referrerData, $referrerSubData); + return Piwik_ArchiveProcessing_Day::getDataTableFromDataArray($array); } /** @@ -161,14 +159,16 @@ class Piwik_Transitions extends Piwik_Plugin $dimension = 'idaction_name_ref'; } - $addSelect = ' - log_action.name, log_action.url_prefix, - CASE WHEN log_link_visit_action.idaction_' . $type . '_ref = ' . intval($idaction) . ' THEN 1 ELSE 0 END AS is_self, - CASE - WHEN log_action.type = ' . $mainActionType . ' THEN 1 - WHEN log_action.type = ' . Piwik_Tracker_Action::TYPE_SITE_SEARCH . ' THEN 2 - ELSE 0 - END AS action_partition'; + $selects = array( + 'log_action.name', + 'log_action.url_prefix', + 'CASE WHEN log_link_visit_action.idaction_' . $type . '_ref = ' . intval($idaction) . ' THEN 1 ELSE 0 END AS is_self', + 'CASE + WHEN log_action.type = ' . $mainActionType . ' THEN 1 + WHEN log_action.type = ' . Piwik_Tracker_Action::TYPE_SITE_SEARCH . ' THEN 2 + ELSE 0 + END AS action_partition' + ); $where = ' log_link_visit_action.idaction_' . $type . ' = ' . intval($idaction); @@ -183,11 +183,8 @@ class Piwik_Transitions extends Piwik_Plugin $dimension = array($dimension); } - $orderBy = '`' . Piwik_Archive::INDEX_NB_ACTIONS . '` DESC'; - $metrics = array(Piwik_Archive::INDEX_NB_ACTIONS); - $data = $archiveProcessing->queryActionsByDimension($dimension, $where, $metrics, $orderBy, - $rankingQuery, $joinLogActionOn, $addSelect); + $data = $archiveProcessing->queryActionsByDimension($dimension, $where, $selects, $metrics, $rankingQuery, $joinLogActionOn); $loops = 0; $nbPageviews = 0; @@ -278,7 +275,7 @@ class Piwik_Transitions extends Piwik_Plugin // site search referrers are logged with url=NULL // when we find one, we have to join on name $joinLogActionColumn = $dimension; - $addSelect = 'log_action.name, log_action.url_prefix, log_action.type'; + $selects = array('log_action.name', 'log_action.url_prefix', 'log_action.type'); } else { // specific setup for page titles: $types[Piwik_Tracker_Action::TYPE_ACTION_NAME] = 'followingPages'; @@ -295,25 +292,25 @@ class Piwik_Transitions extends Piwik_Plugin ELSE log_action1.idaction END '; - $addSelect = ' - CASE + $selects = array( + 'CASE ' /* following site search */ . ' WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.name ' /* following page view: use page title */ . ' WHEN log_action1.type = ' . Piwik_Tracker_Action::TYPE_ACTION_URL . ' THEN log_action2.name ' /* following download or outlink: use url */ . ' ELSE log_action1.name - END AS name, - CASE + END AS name', + 'CASE ' /* following site search */ . ' WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.type ' /* following page view: use page title */ . ' WHEN log_action1.type = ' . Piwik_Tracker_Action::TYPE_ACTION_URL . ' THEN log_action2.type ' /* following download or outlink: use url */ . ' ELSE log_action1.type - END AS type, - NULL AS url_prefix - '; + END AS type', + 'NULL AS url_prefix' + ); } // these types are available for both titles and urls @@ -332,11 +329,8 @@ class Piwik_Transitions extends Piwik_Plugin . 'log_link_visit_action.idaction_' . $type . ' != ' . intval($idaction) . ')'; } - $orderBy = '`' . Piwik_Archive::INDEX_NB_ACTIONS . '` DESC'; - $metrics = array(Piwik_Archive::INDEX_NB_ACTIONS); - $data = $archiveProcessing->queryActionsByDimension($dimension, $where, $metrics, $orderBy, - $rankingQuery, $joinLogActionColumn, $addSelect); + $data = $archiveProcessing->queryActionsByDimension($dimension, $where, $selects, $metrics, $rankingQuery, $joinLogActionColumn); $this->totalTransitionsToFollowingActions = 0; $dataTables = array(); -- cgit v1.2.3 From d8f110aca03ff8c73811a141631f12a7a1ddc16f Mon Sep 17 00:00:00 2001 From: mattab Date: Wed, 12 Jun 2013 16:23:51 +1200 Subject: More refactoring, moving SQL to classes and cleaning up logic so I can understand it (nearly there) --- plugins/Transitions/Transitions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/Transitions/Transitions.php') diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php index b92ef87b8c..b887669a70 100644 --- a/plugins/Transitions/Transitions.php +++ b/plugins/Transitions/Transitions.php @@ -64,7 +64,7 @@ class Piwik_Transitions extends Piwik_Plugin * * @param $idaction * @param $actionType - * @param Piwik_ArchiveProcessing_Day $archiveProcessing + * @param Piwik_ArchiveProcessor_Day $archiveProcessing * @param $limitBeforeGrouping * @return Piwik_DataTable */ @@ -130,7 +130,7 @@ class Piwik_Transitions extends Piwik_Plugin //FIXMEA refactor after integration tests written $array = new Piwik_DataArray($referrerData, $referrerSubData); - return Piwik_ArchiveProcessing_Day::getDataTableFromDataArray($array); + return Piwik_ArchiveProcessor_Day::getDataTableFromDataArray($array); } /** @@ -138,7 +138,7 @@ class Piwik_Transitions extends Piwik_Plugin * * @param $idaction * @param $actionType - * @param Piwik_ArchiveProcessing_Day $archiveProcessing + * @param Piwik_ArchiveProcessor_Day $archiveProcessing * @param $limitBeforeGrouping * @return array(previousPages:Piwik_DataTable, loops:integer) */ @@ -257,12 +257,12 @@ class Piwik_Transitions extends Piwik_Plugin * * @param $idaction * @param $actionType - * @param Piwik_ArchiveProcessing_Day $archiveProcessing + * @param Piwik_ArchiveProcessor_Day $archiveProcessing * @param $limitBeforeGrouping * @param $includeLoops * @return array(followingPages:Piwik_DataTable, outlinks:Piwik_DataTable, downloads:Piwik_DataTable) */ - public function queryFollowingActions($idaction, $actionType, Piwik_ArchiveProcessing_Day $archiveProcessing, + public function queryFollowingActions($idaction, $actionType, Piwik_ArchiveProcessor_Day $archiveProcessing, $limitBeforeGrouping = false, $includeLoops = false) { $types = array(); -- cgit v1.2.3 From 6be9fb2002a0a7da79af55e3263f23c5addfa79c Mon Sep 17 00:00:00 2001 From: mattab Date: Thu, 13 Jun 2013 11:52:49 +1200 Subject: Continuing the great cleanup. It looks like archiveProcessor will have to go (and merge with Archive) Moving Transitions logic from plugin class to API Cleaning up some separation of concerns NOTE: I'm breaking the Multisites API here, removing the _evolution. we should re-fix it... --- plugins/Transitions/Transitions.php | 325 ------------------------------------ 1 file changed, 325 deletions(-) (limited to 'plugins/Transitions/Transitions.php') diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php index b887669a70..2c51da023e 100644 --- a/plugins/Transitions/Transitions.php +++ b/plugins/Transitions/Transitions.php @@ -15,11 +15,6 @@ class Piwik_Transitions extends Piwik_Plugin { - private $limitBeforeGrouping = 5; - private $totalTransitionsToFollowingActions = 0; - - private $returnNormalizedUrls = false; - public function getInformation() { return array( @@ -50,325 +45,5 @@ class Piwik_Transitions extends Piwik_Plugin $jsFiles[] = 'plugins/Transitions/templates/transitions.js'; } - /** - * After calling this method, the query*()-Methods will return urls in their - * normalized form (without the prefix reconstructed) - */ - public function returnNormalizedUrls() - { - $this->returnNormalizedUrls = true; - } - - /** - * Get information about external referrers (i.e. search engines, websites & campaigns) - * - * @param $idaction - * @param $actionType - * @param Piwik_ArchiveProcessor_Day $archiveProcessing - * @param $limitBeforeGrouping - * @return Piwik_DataTable - */ - public function queryExternalReferrers($idaction, $actionType, $archiveProcessing, - $limitBeforeGrouping = false) - { - $rankingQuery = new Piwik_RankingQuery($limitBeforeGrouping ? $limitBeforeGrouping : $this->limitBeforeGrouping); - - // we generate a single column that contains the interesting data for each referrer. - // the reason we cannot group by referer_* becomes clear when we look at search engine keywords. - // referer_url contains the url from the search engine, referer_keyword the keyword we want to - // group by. when we group by both, we don't get a single column for the keyword but instead - // one column per keyword + search engine url. this way, we could not get the top keywords using - // the ranking query. - $dimensions = array('referrer_data', 'referer_type'); - $rankingQuery->addLabelColumn('referrer_data'); - $selects = array( - 'CASE referer_type - WHEN ' . Piwik_Common::REFERER_TYPE_DIRECT_ENTRY . ' THEN \'\' - WHEN ' . Piwik_Common::REFERER_TYPE_SEARCH_ENGINE . ' THEN referer_keyword - WHEN ' . Piwik_Common::REFERER_TYPE_WEBSITE . ' THEN referer_url - WHEN ' . Piwik_Common::REFERER_TYPE_CAMPAIGN . ' THEN CONCAT(referer_name, \' \', referer_keyword) - END AS referrer_data'); - - // get one limited group per referrer type - $rankingQuery->partitionResultIntoMultipleGroups('referer_type', array( - Piwik_Common::REFERER_TYPE_DIRECT_ENTRY, - Piwik_Common::REFERER_TYPE_SEARCH_ENGINE, - Piwik_Common::REFERER_TYPE_WEBSITE, - Piwik_Common::REFERER_TYPE_CAMPAIGN - )); - - $type = $this->getColumnTypeSuffix($actionType); - $where = 'visit_entry_idaction_' . $type . ' = ' . intval($idaction); - - $metrics = array(Piwik_Archive::INDEX_NB_VISITS); - $data = $archiveProcessing->queryVisitsByDimension($dimensions, $where, $selects, $metrics, $rankingQuery); - - $referrerData = array(); - $referrerSubData = array(); - - foreach ($data as $referrerType => &$subData) { - $referrerData[$referrerType] = array(Piwik_Archive::INDEX_NB_VISITS => 0); - if ($referrerType != Piwik_Common::REFERER_TYPE_DIRECT_ENTRY) { - $referrerSubData[$referrerType] = array(); - } - - foreach ($subData as &$row) { - if ($referrerType == Piwik_Common::REFERER_TYPE_SEARCH_ENGINE && empty($row['referrer_data'])) { - $row['referrer_data'] = Piwik_Referers_API::LABEL_KEYWORD_NOT_DEFINED; - } - - $referrerData[$referrerType][Piwik_Archive::INDEX_NB_VISITS] += $row[Piwik_Archive::INDEX_NB_VISITS]; - - $label = $row['referrer_data']; - if ($label) { - $referrerSubData[$referrerType][$label] = array( - Piwik_Archive::INDEX_NB_VISITS => $row[Piwik_Archive::INDEX_NB_VISITS] - ); - } - } - } - - //FIXMEA refactor after integration tests written - $array = new Piwik_DataArray($referrerData, $referrerSubData); - return Piwik_ArchiveProcessor_Day::getDataTableFromDataArray($array); - } - - /** - * Get information about internal referrers (previous pages & loops, i.e. page refreshes) - * - * @param $idaction - * @param $actionType - * @param Piwik_ArchiveProcessor_Day $archiveProcessing - * @param $limitBeforeGrouping - * @return array(previousPages:Piwik_DataTable, loops:integer) - */ - public function queryInternalReferrers($idaction, $actionType, $archiveProcessing, - $limitBeforeGrouping = false) - { - $rankingQuery = new Piwik_RankingQuery($limitBeforeGrouping ? $limitBeforeGrouping : $this->limitBeforeGrouping); - $rankingQuery->addLabelColumn(array('name', 'url_prefix')); - $rankingQuery->setColumnToMarkExcludedRows('is_self'); - $rankingQuery->partitionResultIntoMultipleGroups('action_partition', array(0, 1, 2)); - - $type = $this->getColumnTypeSuffix($actionType); - $mainActionType = Piwik_Tracker_Action::TYPE_ACTION_URL; - $dimension = 'idaction_url_ref'; - $isTitle = $actionType == 'title'; - if ($isTitle) { - $mainActionType = Piwik_Tracker_Action::TYPE_ACTION_NAME; - $dimension = 'idaction_name_ref'; - } - - $selects = array( - 'log_action.name', - 'log_action.url_prefix', - 'CASE WHEN log_link_visit_action.idaction_' . $type . '_ref = ' . intval($idaction) . ' THEN 1 ELSE 0 END AS is_self', - 'CASE - WHEN log_action.type = ' . $mainActionType . ' THEN 1 - WHEN log_action.type = ' . Piwik_Tracker_Action::TYPE_SITE_SEARCH . ' THEN 2 - ELSE 0 - END AS action_partition' - ); - - $where = ' - log_link_visit_action.idaction_' . $type . ' = ' . intval($idaction); - - if ($dimension == 'idaction_url_ref') { - // site search referrers are logged with url_ref=NULL - // when we find one, we have to join on name_ref - $dimension = 'IF( idaction_url_ref IS NULL, idaction_name_ref, idaction_url_ref )'; - $joinLogActionOn = $dimension; - } else { - $joinLogActionOn = $dimension; - $dimension = array($dimension); - } - - $metrics = array(Piwik_Archive::INDEX_NB_ACTIONS); - $data = $archiveProcessing->queryActionsByDimension($dimension, $where, $selects, $metrics, $rankingQuery, $joinLogActionOn); - - $loops = 0; - $nbPageviews = 0; - $previousPagesDataTable = new Piwik_DataTable; - if (isset($data['result'][1])) { - foreach ($data['result'][1] as &$page) { - $nbActions = intval($page[Piwik_Archive::INDEX_NB_ACTIONS]); - $previousPagesDataTable->addRow(new Piwik_DataTable_Row(array( - Piwik_DataTable_Row::COLUMNS => array( - 'label' => $this->getPageLabel($page, $isTitle), - Piwik_Archive::INDEX_NB_ACTIONS => $nbActions - ) - ))); - $nbPageviews += $nbActions; - } - } - - $previousSearchesDataTable = new Piwik_DataTable; - if (isset($data['result'][2])) { - foreach ($data['result'][2] as &$search) { - $nbActions = intval($search[Piwik_Archive::INDEX_NB_ACTIONS]); - $previousSearchesDataTable->addRow(new Piwik_DataTable_Row(array( - Piwik_DataTable_Row::COLUMNS => array( - 'label' => $search['name'], - Piwik_Archive::INDEX_NB_ACTIONS => $nbActions - ) - ))); - $nbPageviews += $nbActions; - } - } - - if (isset($data['result'][0])) { - foreach ($data['result'][0] as &$referrer) { - $nbPageviews += intval($referrer[Piwik_Archive::INDEX_NB_ACTIONS]); - } - } - - if (count($data['excludedFromLimit'])) { - $loops += intval($data['excludedFromLimit'][0][Piwik_Archive::INDEX_NB_ACTIONS]); - $nbPageviews += $loops; - } - - return array( - 'pageviews' => $nbPageviews, - 'previousPages' => $previousPagesDataTable, - 'previousSiteSearches' => $previousSearchesDataTable, - 'loops' => $loops - ); - } - - private function getPageLabel(&$pageRecord, $isTitle) - { - if ($isTitle) { - $label = $pageRecord['name']; - if (empty($label)) { - $label = Piwik_Actions_ArchivingHelper::getUnknownActionName( - Piwik_Tracker_Action::TYPE_ACTION_NAME); - } - return $label; - } else if ($this->returnNormalizedUrls) { - return $pageRecord['name']; - } else { - return Piwik_Tracker_Action::reconstructNormalizedUrl( - $pageRecord['name'], $pageRecord['url_prefix']); - } - } - - /** - * Get information about the following actions (following pages, site searches, outlinks, downloads) - * - * @param $idaction - * @param $actionType - * @param Piwik_ArchiveProcessor_Day $archiveProcessing - * @param $limitBeforeGrouping - * @param $includeLoops - * @return array(followingPages:Piwik_DataTable, outlinks:Piwik_DataTable, downloads:Piwik_DataTable) - */ - public function queryFollowingActions($idaction, $actionType, Piwik_ArchiveProcessor_Day $archiveProcessing, - $limitBeforeGrouping = false, $includeLoops = false) - { - $types = array(); - - $isTitle = ($actionType == 'title'); - if (!$isTitle) { - // specific setup for page urls - $types[Piwik_Tracker_Action::TYPE_ACTION_URL] = 'followingPages'; - $dimension = 'IF( idaction_url IS NULL, idaction_name, idaction_url )'; - // site search referrers are logged with url=NULL - // when we find one, we have to join on name - $joinLogActionColumn = $dimension; - $selects = array('log_action.name', 'log_action.url_prefix', 'log_action.type'); - } else { - // specific setup for page titles: - $types[Piwik_Tracker_Action::TYPE_ACTION_NAME] = 'followingPages'; - // join log_action on name and url and pick depending on url type - // the table joined on url is log_action1 - $joinLogActionColumn = array('idaction_url', 'idaction_name'); - $dimension = ' - CASE - ' /* following site search */ . ' - WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.idaction - ' /* following page view: use page title */ . ' - WHEN log_action1.type = ' . Piwik_Tracker_Action::TYPE_ACTION_URL . ' THEN log_action2.idaction - ' /* following download or outlink: use url */ . ' - ELSE log_action1.idaction - END - '; - $selects = array( - 'CASE - ' /* following site search */ . ' - WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.name - ' /* following page view: use page title */ . ' - WHEN log_action1.type = ' . Piwik_Tracker_Action::TYPE_ACTION_URL . ' THEN log_action2.name - ' /* following download or outlink: use url */ . ' - ELSE log_action1.name - END AS name', - 'CASE - ' /* following site search */ . ' - WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.type - ' /* following page view: use page title */ . ' - WHEN log_action1.type = ' . Piwik_Tracker_Action::TYPE_ACTION_URL . ' THEN log_action2.type - ' /* following download or outlink: use url */ . ' - ELSE log_action1.type - END AS type', - 'NULL AS url_prefix' - ); - } - - // these types are available for both titles and urls - $types[Piwik_Tracker_Action::TYPE_SITE_SEARCH] = 'followingSiteSearches'; - $types[Piwik_Tracker_Action::TYPE_OUTLINK] = 'outlinks'; - $types[Piwik_Tracker_Action::TYPE_DOWNLOAD] = 'downloads'; - - $rankingQuery = new Piwik_RankingQuery($limitBeforeGrouping ? $limitBeforeGrouping : $this->limitBeforeGrouping); - $rankingQuery->addLabelColumn(array('name', 'url_prefix')); - $rankingQuery->partitionResultIntoMultipleGroups('type', array_keys($types)); - - $type = $this->getColumnTypeSuffix($actionType); - $where = 'log_link_visit_action.idaction_' . $type . '_ref = ' . intval($idaction); - if (!$includeLoops) { - $where .= ' AND (log_link_visit_action.idaction_' . $type . ' IS NULL OR ' - . 'log_link_visit_action.idaction_' . $type . ' != ' . intval($idaction) . ')'; - } - - $metrics = array(Piwik_Archive::INDEX_NB_ACTIONS); - $data = $archiveProcessing->queryActionsByDimension($dimension, $where, $selects, $metrics, $rankingQuery, $joinLogActionColumn); - - $this->totalTransitionsToFollowingActions = 0; - $dataTables = array(); - foreach ($types as $type => $recordName) { - $dataTable = new Piwik_DataTable; - if (isset($data[$type])) { - foreach ($data[$type] as &$record) { - $actions = intval($record[Piwik_Archive::INDEX_NB_ACTIONS]); - $dataTable->addRow(new Piwik_DataTable_Row(array( - Piwik_DataTable_Row::COLUMNS => array( - 'label' => $this->getPageLabel($record, $isTitle), - Piwik_Archive::INDEX_NB_ACTIONS => $actions - ) - ))); - $this->totalTransitionsToFollowingActions += $actions; - } - } - $dataTables[$recordName] = $dataTable; - } - - return $dataTables; - } - - /** - * Get the sum of all transitions to following actions (pages, outlinks, downloads). - * Only works if queryFollowingActions() has been used directly before. - */ - public function getTotalTransitionsToFollowingActions() - { - return $this->totalTransitionsToFollowingActions; - } - - private function getColumnTypeSuffix($actionType) - { - if ($actionType == 'title') { - return 'name'; - } - return 'url'; - } } \ No newline at end of file -- cgit v1.2.3