当前位置: 首页>>代码示例>>PHP>>正文


PHP Archive::getDataTableFromArchive方法代码示例

本文整理汇总了PHP中Piwik\Archive::getDataTableFromArchive方法的典型用法代码示例。如果您正苦于以下问题:PHP Archive::getDataTableFromArchive方法的具体用法?PHP Archive::getDataTableFromArchive怎么用?PHP Archive::getDataTableFromArchive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Archive的用法示例。


在下文中一共展示了Archive::getDataTableFromArchive方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getDataTable

 /**
  * @param string $name
  * @param int $idSite
  * @param string $period
  * @param string|Date $date
  * @param string $segment
  * @param bool $expanded
  * @param int|null $idSubtable
  * @return DataTable
  */
 protected function getDataTable($name, $idSite, $period, $date, $segment, $expanded = false, $idSubtable = null)
 {
     $dataTable = Archive::getDataTableFromArchive($name, $idSite, $period, $date, $segment, $expanded, $idSubtable);
     $dataTable->filter('Sort', array(Metrics::INDEX_NB_VISITS, 'desc', $naturalSort = false, $expanded));
     $dataTable->queueFilter('ReplaceColumnNames');
     return $dataTable;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:17,代码来源:API.php

示例2: getDataTable

 private function getDataTable($name, $idSite, $period, $date, $segment, $expanded, $idSubtable)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $recordName = Dimensions::getRecordNameForAction($name);
     $dataTable = Archive::getDataTableFromArchive($recordName, $idSite, $period, $date, $segment, $expanded, $idSubtable);
     $this->filterDataTable($dataTable);
     return $dataTable;
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:8,代码来源:API.php

示例3: getDataTable

 /**
  * @param int $idSite
  * @param string $period
  * @param Date $date
  * @param string $segment
  * @param bool $expanded
  * @param int $idSubtable
  *
  * @return DataTable|DataTable\Map
  */
 protected function getDataTable($idSite, $period, $date, $segment, $expanded, $idSubtable)
 {
     $dataTable = Archive::getDataTableFromArchive(Archiver::CUSTOM_VARIABLE_RECORD_NAME, $idSite, $period, $date, $segment, $expanded, $idSubtable);
     $dataTable->filter('Sort', array(Metrics::INDEX_NB_ACTIONS, 'desc', $naturalSort = false, $expanded));
     $dataTable->queueFilter('ReplaceColumnNames');
     $dataTable->queueFilter('ColumnDelete', 'nb_uniq_visitors');
     return $dataTable;
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:18,代码来源:API.php

示例4: getDataTable

 private function getDataTable($name, $idSite, $period, $date, $segment, $expanded, $idSubtable)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $recordName = Dimensions::getRecordNameForAction($name);
     $dataTable = Archive::getDataTableFromArchive($recordName, $idSite, $period, $date, $segment, $expanded, $idSubtable);
     if (empty($idSubtable)) {
         $dataTable->filter('AddSegmentValue', array(function ($label) {
             if ($label === Archiver::CONTENT_PIECE_NOT_SET) {
                 return false;
             }
             return $label;
         }));
     }
     $this->filterDataTable($dataTable);
     return $dataTable;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:16,代码来源:API.php

示例5: bannerStats

 private function bannerStats($bannerName, $params)
 {
     $contentPiece = false;
     if (strpos($bannerName, '_') !== false) {
         list($bannerName, $contentPiece) = explode('_', $bannerName);
     }
     $segment = 'contentName==' . $bannerName;
     $recordName = Dimensions::getRecordNameForAction('getContentPieces');
     $subTable = Archive::getDataTableFromArchive($recordName, $params['idSite'], $params['period'], $params['date'], $segment, true);
     //echo '<pre>';
     $bannerTable = new DataTable();
     if (!$contentPiece) {
         foreach ($subTable->getRows() as $row) {
             $ContentPieceId = Db::fetchOne("SELECT idaction FROM piwik_log_action WHERE TYPE = 14 and name = ?", array($row->getColumn('label')));
             $bannerRow = new Row(array(Row::COLUMNS => array('Label' => $row->getColumn('label'), 'Impressions' => $row->getColumn(41), 'Interactions' => $row->getColumn(42), 'Conversion rate' => $this->interactionRate($row->getColumn(41), $row->getColumn(42))), Row::DATATABLE_ASSOCIATED => implode('_', array($bannerName, $ContentPieceId))));
             $bannerTable->addRow($bannerRow);
         }
     } else {
         $orderColumn = str_replace(' ', '_', strtolower($params['filter_sort_column']));
         $orderOrder = in_array($params['filter_sort_order'], array('asc', 'desc')) ? $params['filter_sort_order'] : 'asc';
         $orderLimit = intval($params['filter_limit']);
         $where = '';
         /*
         TODO: filter_pattern is processed by piwik in some way. The results are good with this query, but piwik does some post-processing?
         if (isset($params['filter_pattern'])) {
              $where = 'and piwik_log_action.name like "%' .  $params['filter_pattern'] . '%"';
         }
         */
         $result = Db::fetchAll("\n                    SELECT \n                        trim(substring_index(piwik_log_action.name, '|', 1)) as referrer,\n                        trim(substring_index(piwik_log_action.name, '|', -1)) as target,\n                        sum(IF(idaction_content_interaction is null, 1, 0)) as impressions, \n                        sum(IF(idaction_content_interaction is null, 0, 1)) as interactions,\n                        ((100 / sum(IF(idaction_content_interaction is null, 1, 0))) * sum(IF(idaction_content_interaction is null, 0, 1))) as conversion_rate\n                    FROM piwik_log_link_visit_action \n                    left join piwik_log_action on piwik_log_action.idaction = idaction_content_target\n                    WHERE \n                        idaction_content_name in (SELECT idaction FROM piwik_log_action WHERE name = ?)\n                    and\n                        idaction_content_piece = ?\n                    \n                    {$where}\n\n                    group by piwik_log_action.name\n                    order by {$orderColumn} {$orderOrder}\n                    limit {$orderLimit}\n            ", array($bannerName, $contentPiece));
         foreach ($result as $row) {
             $bannerRow = new Row(array(Row::COLUMNS => array('Referrer' => $row['referrer'], 'Target' => $row['target'], 'Impressions' => $row['impressions'], 'Interactions' => $row['interactions'], 'Conversion rate' => round($row['conversion_rate']) . '%')));
             $bannerTable->addRow($bannerRow);
         }
     }
     return $bannerTable;
 }
开发者ID:ronaldbaltus,项目名称:VPSCashPiwikBannerPlugin,代码行数:36,代码来源:API.php

示例6: getDataTable

 protected function getDataTable($name, $idSite, $period, $date, $segment, $expanded = false, $idSubtable = null, $secondaryDimension = false)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $this->checkSecondaryDimension($name, $secondaryDimension);
     $recordName = $this->getRecordNameForAction($name, $secondaryDimension);
     $dataTable = Archive::getDataTableFromArchive($recordName, $idSite, $period, $date, $segment, $expanded, $idSubtable);
     $this->filterDataTable($dataTable);
     return $dataTable;
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:9,代码来源:API.php

示例7: getDataTableFromArchive

 protected function getDataTableFromArchive($name, $idSite, $period, $date, $segment, $expanded = false, $idSubtable = null, $depth = null)
 {
     $skipAggregationOfSubTables = false;
     if ($period == 'range' && empty($idSubtable) && empty($expanded) && !Request::shouldLoadFlatten()) {
         $skipAggregationOfSubTables = false;
     }
     return Archive::getDataTableFromArchive($name, $idSite, $period, $date, $segment, $expanded, $idSubtable, $skipAggregationOfSubTables, $depth);
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:8,代码来源:API.php

示例8: getDataTable

 /**
  * @param string $name
  * @param int $idSite
  * @param string $period
  * @param string|Date $date
  * @param string $segment
  * @param bool $expanded
  * @param int|null $idSubtable
  * @return DataTable
  */
 protected function getDataTable($name, $idSite, $period, $date, $segment, $expanded = false, $idSubtable = null)
 {
     $dataTable = Archive::getDataTableFromArchive($name, $idSite, $period, $date, $segment, $expanded, $idSubtable);
     $dataTable->queueFilter('ReplaceColumnNames');
     return $dataTable;
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:16,代码来源:API.php

示例9: getSiteSearchKeywordsRaw

 protected function getSiteSearchKeywordsRaw($idSite, $period, $date, $segment)
 {
     $dataTable = Archive::getDataTableFromArchive('Actions_sitesearch', $idSite, $period, $date, $segment, $expanded = false);
     return $dataTable;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:5,代码来源:API.php

示例10: getNewUsers

 /**
  * Another example method that returns a data table.
  * @param int    $idSite
  * @param string $period
  * @param string $date
  * @param bool|string $segment
  * @return DataTable
  */
 public function getNewUsers($idSite, $period, $date, $segment = false)
 {
     $dataTable = Archive::getDataTableFromArchive('ClientCertificates_GetNewUsers', $idSite, $period, $date, $segment, false);
     $dataTable->queueFilter('ReplaceColumnNames');
     $dataTable->queueFilter('ReplaceSummaryRowLabel');
     $dataTable->queueFilter(function (DataTable $table) {
         foreach ($table->getRows() as $visitRow) {
             $visitor_returning = $visitRow->getColumn('label');
             if ($visitor_returning) {
                 $visitRow->setColumn('label', 'Returning Users');
             } else {
                 $visitRow->setColumn('label', 'New Users');
             }
         }
         $rowId = $table->getRowIdFromLabel('Returning Users');
         if ($rowId !== false) {
             $table->deleteRow($rowId);
         }
     });
     return $dataTable;
 }
开发者ID:TensorWrenchOSS,项目名称:piwik-plugin-ClientCertificates,代码行数:29,代码来源:API.php


注:本文中的Piwik\Archive::getDataTableFromArchive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。