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


PHP DataTable::getColumn方法代码示例

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


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

示例1: filterTable

 private function filterTable($withUser = 5)
 {
     $dataTable = new DataTable();
     $dataTable->addRowsFromArray(array(array(Row::COLUMNS => array('label' => 'val1', Metrics::INDEX_NB_USERS => 0)), array(Row::COLUMNS => array('label' => 'val2')), array(Row::COLUMNS => array('label' => 'val2 5w ö?', Metrics::INDEX_NB_USERS => $withUser))));
     $dataTable->filter($this->filter, array($idSite = 1, $period = 'day', $date = 'today'));
     return $dataTable->getColumn(Metrics::INDEX_NB_USERS);
 }
开发者ID:ep123,项目名称:plugin-CustomDimensions,代码行数:7,代码来源:RemoveUserIfNeededTest.php

示例2: addVisitsPercentColumn

 /**
  * Utility function that adds a visit percent column to a data table,
  * regardless of whether the data table is an data table array or just
  * a data table.
  *
  * @param DataTable $dataTable The data table to modify.
  */
 private static function addVisitsPercentColumn($dataTable)
 {
     if ($dataTable instanceof DataTable\Map) {
         foreach ($dataTable->getDataTables() as $table) {
             self::addVisitsPercentColumn($table);
         }
     } else {
         $totalVisits = array_sum($dataTable->getColumn(Metrics::INDEX_NB_VISITS));
         $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('nb_visits_percentage', 'nb_visits', $totalVisits));
     }
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:18,代码来源:API.php

示例3: assertRows

 private function assertRows($expectedLabels, DataTable $dataTable)
 {
     $this->assertEquals($expectedLabels, $dataTable->getColumn('label'));
     $this->assertEquals(count($expectedLabels), $dataTable->getRowsCount());
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:5,代码来源:ApiTest.php

示例4: filterPageDatatable

 /**
  * Common filters for Page URLs and Page Titles
  *
  * @param DataTable|DataTable\Simple|DataTable\Map $dataTable
  */
 protected function filterPageDatatable($dataTable)
 {
     $columnsToRemove = array('bounce_rate');
     $dataTable->queueFilter('ColumnDelete', array($columnsToRemove));
     // Average time on page = total time on page / number visits on that page
     $dataTable->queueFilter('ColumnCallbackAddColumnQuotient', array('avg_time_on_page', 'sum_time_spent', 'nb_visits', 0));
     // Bounce rate = single page visits on this page / visits started on this page
     $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('bounce_rate', 'entry_bounce_count', 'entry_nb_visits', 0));
     // % Exit = Number of visits that finished on this page / visits on this page
     $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('exit_rate', 'exit_nb_visits', 'nb_visits', 0));
     // Handle performance analytics
     $hasTimeGeneration = array_sum($dataTable->getColumn(Metrics::INDEX_PAGE_SUM_TIME_GENERATION)) > 0;
     if ($hasTimeGeneration) {
         // Average generation time = total generation time / number of pageviews
         $precisionAvgTimeGeneration = 3;
         $dataTable->queueFilter('ColumnCallbackAddColumnQuotient', array('avg_time_generation', 'sum_time_generation', 'nb_hits_with_time_generation', $precisionAvgTimeGeneration));
         $dataTable->queueFilter('ColumnDelete', array(array('sum_time_generation')));
     } else {
         // No generation time: remove it from the API output and add it to empty_columns metadata, so that
         // the columns can also be removed from the view
         $dataTable->filter('ColumnDelete', array(array(Metrics::INDEX_PAGE_SUM_TIME_GENERATION, Metrics::INDEX_PAGE_NB_HITS_WITH_TIME_GENERATION, Metrics::INDEX_PAGE_MIN_TIME_GENERATION, Metrics::INDEX_PAGE_MAX_TIME_GENERATION)));
         if ($dataTable instanceof DataTable) {
             $emptyColumns = $dataTable->getMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME);
             if (!is_array($emptyColumns)) {
                 $emptyColumns = array();
             }
             $emptyColumns[] = 'sum_time_generation';
             $emptyColumns[] = 'avg_time_generation';
             $emptyColumns[] = 'min_time_generation';
             $emptyColumns[] = 'max_time_generation';
             $dataTable->setMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME, $emptyColumns);
         }
     }
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:39,代码来源:API.php

示例5: isReportContainsUnsetVisitsColumns

 /**
  * @return bool
  */
 protected function isReportContainsUnsetVisitsColumns(DataTable $report)
 {
     $visits = $report->getColumn('nb_visits');
     $isVisitsMetricsSometimesUnset = in_array(false, $visits);
     return $isVisitsMetricsSometimesUnset;
 }
开发者ID:ankygoyal,项目名称:piwik,代码行数:9,代码来源:GetCustomVariables.php

示例6: initChartObjectData

 /**
  * @param DataTable|DataTable\Map $dataTable
  * @param $visualization
  */
 protected function initChartObjectData($dataTable, $visualization)
 {
     // We apply a filter to the DataTable, decoding the label column (useful for keywords for example)
     $dataTable->filter('ColumnCallbackReplace', array('label', 'urldecode'));
     $xLabels = $dataTable->getColumn('label');
     $columnNames = $this->properties['columns_to_display'];
     if (($labelColumnIndex = array_search('label', $columnNames)) !== false) {
         unset($columnNames[$labelColumnIndex]);
     }
     $columnNameToTranslation = $columnNameToValue = array();
     foreach ($columnNames as $columnName) {
         $columnNameToTranslation[$columnName] = @$this->properties['translations'][$columnName];
         $columnNameToValue[$columnName] = $dataTable->getColumn($columnName);
     }
     $visualization->dataTable = $dataTable;
     $visualization->properties = $this->properties;
     $visualization->setAxisXLabels($xLabels);
     $visualization->setAxisYValues($columnNameToValue);
     $visualization->setAxisYLabels($columnNameToTranslation);
     $units = $this->getUnitsForColumnsToDisplay();
     $visualization->setAxisYUnits($units);
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:26,代码来源:JqplotDataGenerator.php

示例7: assertOrder

 protected function assertOrder($expectedOrder)
 {
     $this->assertEquals($expectedOrder, $this->table->getColumn('label'));
     $this->assertEquals(count($expectedOrder), $this->table->getRowsCount());
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:5,代码来源:BaseUnitTest.php

示例8: assertOrder

 private function assertOrder(DataTable $table, $expectedOrder)
 {
     $this->assertEquals($expectedOrder, $table->getColumn('label'));
     $this->assertEquals(count($expectedOrder), $table->getRowsCount());
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:5,代码来源:InsightReportTest.php

示例9: initChartObjectData

 /**
  * @param DataTable|DataTable\Map $dataTable
  * @param $visualization
  */
 protected function initChartObjectData($dataTable, $visualization)
 {
     $xLabels = $dataTable->getColumn('label');
     $columnNames = $this->properties['columns_to_display'];
     if (($labelColumnIndex = array_search('label', $columnNames)) !== false) {
         unset($columnNames[$labelColumnIndex]);
     }
     $columnNameToTranslation = $columnNameToValue = array();
     foreach ($columnNames as $columnName) {
         $columnNameToTranslation[$columnName] = @$this->properties['translations'][$columnName];
         $columnNameToValue[$columnName] = $dataTable->getColumn($columnName);
     }
     $visualization->dataTable = $dataTable;
     $visualization->properties = $this->properties;
     $visualization->setAxisXLabels($xLabels);
     $visualization->setAxisYValues($columnNameToValue);
     $visualization->setAxisYLabels($columnNameToTranslation);
     $units = $this->getUnitsForColumnsToDisplay();
     $visualization->setAxisYUnits($units);
 }
开发者ID:piwik,项目名称:piwik,代码行数:24,代码来源:JqplotDataGenerator.php


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