diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-02-26 05:07:19 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-03-05 05:31:18 +0300 |
commit | a1cb3695319b321f92bb0a4fd31892a9bc1bdf38 (patch) | |
tree | 95c813ee950d38fd74c5c125645cca144ff3ea4f | |
parent | b8f07213450f570174becd807a6932ac69050fe4 (diff) |
this makes flatten pageUrls much faster
-rw-r--r-- | core/API/DataTableManipulator.php | 8 | ||||
-rw-r--r-- | plugins/Actions/API.php | 7 |
2 files changed, 14 insertions, 1 deletions
diff --git a/core/API/DataTableManipulator.php b/core/API/DataTableManipulator.php index 862f2db087..23036c8e82 100644 --- a/core/API/DataTableManipulator.php +++ b/core/API/DataTableManipulator.php @@ -114,6 +114,14 @@ abstract class DataTableManipulator return null; } + if ($row->getMetadata('idsubdatatable_in_db')) { + $manager = DataTable\Manager::getInstance(); + $table = $manager->getTable($idSubTable); + if ($table) { + return $table; + } + } + $request['idSubtable'] = $idSubTable; if ($dataTable) { $period = $dataTable->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX); diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php index 91f1d70c45..0ec50bceea 100644 --- a/plugins/Actions/API.php +++ b/plugins/Actions/API.php @@ -88,10 +88,15 @@ class API extends \Piwik\Plugin\API * @return DataTable|DataTable\Map */ public function getPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, - $depth = false) + $depth = false, $flat= false) { + if ($flat && !$idSubtable) { + $expanded = true; + } + $dataTable = $this->getDataTableFromArchive('Actions_actions_url', $idSite, $period, $date, $segment, $expanded, $idSubtable, $depth); $this->filterActionsDataTable($dataTable, $expanded); + return $dataTable; } |