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


PHP Row::deleteColumn方法代码示例

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


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

示例1: test_deleteColumn_shouldReturnAColumnValueThatIsNull

 public function test_deleteColumn_shouldReturnAColumnValueThatIsNull()
 {
     $this->row->setColumn('label', null);
     $this->assertTrue($this->row->hasColumn('label'));
     $this->assertTrue($this->row->deleteColumn('label'));
     $this->assertFalse($this->row->hasColumn('label'));
 }
开发者ID:cemo,项目名称:piwik,代码行数:7,代码来源:RowTest.php

示例2: deleteColumns

 /**
  * Deletes several columns by name in every row.
  *
  * @param array $names List of column names to delete.
  * @param bool $deleteRecursiveInSubtables Whether to apply this change to all subtables or not.
  */
 public function deleteColumns($names, $deleteRecursiveInSubtables = false)
 {
     foreach ($this->rows as $row) {
         foreach ($names as $name) {
             $row->deleteColumn($name);
         }
         $subTable = $row->getSubtable();
         if ($subTable) {
             $subTable->deleteColumns($names, $deleteRecursiveInSubtables);
         }
     }
     if (!is_null($this->summaryRow)) {
         foreach ($names as $name) {
             $this->summaryRow->deleteColumn($name);
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:23,代码来源:DataTable.php

示例3: deleteColumns

 /**
  * Deletes several columns by name in every row.
  *
  * @param array $names List of column names to delete.
  * @param bool $deleteRecursiveInSubtables Whether to apply this change to all subtables or not.
  */
 public function deleteColumns($names, $deleteRecursiveInSubtables = false)
 {
     foreach ($this->getRows() as $row) {
         foreach ($names as $name) {
             $row->deleteColumn($name);
         }
         if (($idSubDataTable = $row->getIdSubDataTable()) !== null) {
             Manager::getInstance()->getTable($idSubDataTable)->deleteColumns($names, $deleteRecursiveInSubtables);
         }
     }
     if (!is_null($this->summaryRow)) {
         foreach ($names as $name) {
             $this->summaryRow->deleteColumn($name);
         }
     }
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:22,代码来源:DataTable.php

示例4: enrichWithUniqueVisitorsMetric

 protected function enrichWithUniqueVisitorsMetric(Row $row)
 {
     if (!$this->getParams()->isSingleSite()) {
         // we only compute unique visitors for a single site
         return;
     }
     if ($row->getColumn('nb_uniq_visitors') !== false) {
         if (SettingsPiwik::isUniqueVisitorsEnabled($this->getParams()->getPeriod()->getLabel())) {
             $uniqueVisitors = (double) $this->computeNbUniqVisitors();
             $row->setColumn('nb_uniq_visitors', $uniqueVisitors);
         } else {
             $row->deleteColumn('nb_uniq_visitors');
         }
     }
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:15,代码来源:ArchiveProcessor.php

示例5: enrichWithUniqueVisitorsMetric

 protected function enrichWithUniqueVisitorsMetric(Row $row)
 {
     // skip unique visitors metrics calculation if calculating for multiple sites is disabled
     if (!$this->getParams()->isSingleSite() && $this->skipUniqueVisitorsCalculationForMultipleSites) {
         return;
     }
     if ($row->getColumn('nb_uniq_visitors') === false && $row->getColumn('nb_users') === false) {
         return;
     }
     if (!SettingsPiwik::isUniqueVisitorsEnabled($this->getParams()->getPeriod()->getLabel())) {
         $row->deleteColumn('nb_uniq_visitors');
         $row->deleteColumn('nb_users');
         return;
     }
     $metrics = array(Metrics::INDEX_NB_USERS);
     if ($this->getParams()->isSingleSite()) {
         $uniqueVisitorsMetric = Metrics::INDEX_NB_UNIQ_VISITORS;
     } else {
         if (!SettingsPiwik::isSameFingerprintAcrossWebsites()) {
             throw new Exception("Processing unique visitors across websites is enabled for this instance,\n                            but to process this metric you must first set enable_fingerprinting_across_websites=1\n                            in the config file, under the [Tracker] section.");
         }
         $uniqueVisitorsMetric = Metrics::INDEX_NB_UNIQ_FINGERPRINTS;
     }
     $metrics[] = $uniqueVisitorsMetric;
     $uniques = $this->computeNbUniques($metrics);
     // see edge case as described in https://github.com/piwik/piwik/issues/9357 where uniq_visitors might be higher
     // than visits because we archive / process it after nb_visits. Between archiving nb_visits and nb_uniq_visitors
     // there could have been a new visit leading to a higher nb_unique_visitors than nb_visits which is not possible
     // by definition. In this case we simply use the visits metric instead of unique visitors metric.
     $visits = $row->getColumn('nb_visits');
     if ($visits !== false && $uniques[$uniqueVisitorsMetric] !== false) {
         $uniques[$uniqueVisitorsMetric] = min($uniques[$uniqueVisitorsMetric], $visits);
     }
     $row->setColumn('nb_uniq_visitors', $uniques[$uniqueVisitorsMetric]);
     $row->setColumn('nb_users', $uniques[Metrics::INDEX_NB_USERS]);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:36,代码来源:ArchiveProcessor.php

示例6: enrichWithUniqueVisitorsMetric

 protected function enrichWithUniqueVisitorsMetric(Row $row)
 {
     // skip unique visitors metrics calculation if calculating for multiple sites is disabled
     if (!$this->getParams()->isSingleSite() && $this->skipUniqueVisitorsCalculationForMultipleSites) {
         return;
     }
     if ($row->getColumn('nb_uniq_visitors') === false && $row->getColumn('nb_users') === false) {
         return;
     }
     if (!SettingsPiwik::isUniqueVisitorsEnabled($this->getParams()->getPeriod()->getLabel())) {
         $row->deleteColumn('nb_uniq_visitors');
         $row->deleteColumn('nb_users');
         return;
     }
     $metrics = array(Metrics::INDEX_NB_USERS);
     if ($this->getParams()->isSingleSite()) {
         $uniqueVisitorsMetric = Metrics::INDEX_NB_UNIQ_VISITORS;
     } else {
         if (!SettingsPiwik::isSameFingerprintAcrossWebsites()) {
             throw new Exception("Processing unique visitors across websites is enabled for this instance,\n                            but to process this metric you must first set enable_fingerprinting_across_websites=1\n                            in the config file, under the [Tracker] section.");
         }
         $uniqueVisitorsMetric = Metrics::INDEX_NB_UNIQ_FINGERPRINTS;
     }
     $metrics[] = $uniqueVisitorsMetric;
     $uniques = $this->computeNbUniques($metrics);
     $row->setColumn('nb_uniq_visitors', $uniques[$uniqueVisitorsMetric]);
     $row->setColumn('nb_users', $uniques[Metrics::INDEX_NB_USERS]);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:28,代码来源:ArchiveProcessor.php

示例7: enrichWithUniqueVisitorsMetric

 protected function enrichWithUniqueVisitorsMetric(Row $row)
 {
     // skip unique visitors metrics calculation if calculating for multiple sites is disabled
     if (!$this->getParams()->isSingleSite() && $this->skipUniqueVisitorsCalculationForMultipleSites) {
         return;
     }
     if ($row->getColumn('nb_uniq_visitors') !== false || $row->getColumn('nb_users') !== false) {
         if (SettingsPiwik::isUniqueVisitorsEnabled($this->getParams()->getPeriod()->getLabel())) {
             $metrics = array(Metrics::INDEX_NB_UNIQ_VISITORS, Metrics::INDEX_NB_USERS);
             $uniques = $this->computeNbUniques($metrics);
             $row->setColumn('nb_uniq_visitors', $uniques[Metrics::INDEX_NB_UNIQ_VISITORS]);
             $row->setColumn('nb_users', $uniques[Metrics::INDEX_NB_USERS]);
         } else {
             $row->deleteColumn('nb_uniq_visitors');
             $row->deleteColumn('nb_users');
         }
     }
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:18,代码来源:ArchiveProcessor.php


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