diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2013-10-22 08:01:08 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2013-10-22 09:57:54 +0400 |
commit | a10eb83bfc85221b0afaedccfae881a55639d782 (patch) | |
tree | 9e47d643ec36a610cb9a327a85d7e64dea196cbc /plugins/Actions/API.php | |
parent | b969dc796fe9a0116ef7481d009ef10c2ca7dc0a (diff) |
Refs #4200, make DataTable:: private & add public methods necessary, tweaking some filter docs, and remove AddConstantMetadata filter.
Diffstat (limited to 'plugins/Actions/API.php')
-rw-r--r-- | plugins/Actions/API.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php index 84ceca80ac..5e15d1b770 100644 --- a/plugins/Actions/API.php +++ b/plugins/Actions/API.php @@ -347,10 +347,12 @@ class API extends \Piwik\Plugin\API $dataTables = $dataTable->getDataTables(); foreach ($customVariableDatatables as $key => $customVariableTableForDate) { // we do not enter the IF, in the case idSite=1,3 AND period=day&date=datefrom,dateto, - if (isset($customVariableTableForDate->metadata['period'])) { + if ($customVariableTableForDate instanceof DataTable + && $customVariableTableForDate->getMetadata('period') + ) { $row = $customVariableTableForDate->getRowFromLabel($customVarNameToLookFor); if ($row) { - $dateRewrite = $customVariableTableForDate->metadata['period']->getDateStart()->toString(); + $dateRewrite = $customVariableTableForDate->getMetadata('period')->getDateStart()->toString(); $idSubtable = $row->getIdSubDataTable(); $categories = APICustomVariables::getInstance()->getCustomVariablesValuesFromNameId($idSite, $period, $dateRewrite, $idSubtable, $segment); $dataTable->addTable($categories, $key); @@ -443,7 +445,7 @@ class API extends \Piwik\Plugin\API if ($row === false) { // not found $result = new DataTable; - $result->metadata = $table->metadata; + $result->setAllTableMetadata($table->getAllTableMetadata()); return $result; } @@ -451,7 +453,7 @@ class API extends \Piwik\Plugin\API if (count($searchTree) == 0) { $result = new DataTable(); $result->addRow($row); - $result->metadata = $table->metadata; + $result->setAllTableMetadata($table->getAllTableMetadata()); return $result; } |