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


PHP DataTable::deleteRow方法代码示例

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


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

示例1: filter

 /**
  * See {@link PatternRecursive}.
  * 
  * @param DataTable $table
  * @return int The number of deleted rows.
  */
 public function filter($table)
 {
     $rows = $table->getRows();
     foreach ($rows as $key => $row) {
         // A row is deleted if
         // 1 - its label doesnt contain the pattern
         // AND 2 - the label is not found in the children
         $patternNotFoundInChildren = false;
         try {
             $idSubTable = $row->getIdSubDataTable();
             $subTable = Manager::getInstance()->getTable($idSubTable);
             // we delete the row if we couldn't find the pattern in any row in the
             // children hierarchy
             if ($this->filter($subTable) == 0) {
                 $patternNotFoundInChildren = true;
             }
         } catch (Exception $e) {
             // there is no subtable loaded for example
             $patternNotFoundInChildren = true;
         }
         if ($patternNotFoundInChildren && !Pattern::match($this->patternToSearchQuoted, $row->getColumn($this->columnToFilter), $invertedMatch = false)) {
             $table->deleteRow($key);
         }
     }
     return $table->getRowsCount();
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:32,代码来源:PatternRecursive.php

示例2: deleteRowsWithNoVisit

 private function deleteRowsWithNoVisit(DataTable $table)
 {
     foreach ($table->getRows() as $key => $row) {
         $nbVisits = Metric::getMetric($row, 'nb_visits');
         $nbActions = Metric::getMetric($row, 'nb_actions');
         if ($nbVisits == 0 && $nbActions == 0) {
             // case of keyword/website/campaign with a conversion for this day, but no visit, we don't show it
             $table->deleteRow($key);
         }
     }
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:11,代码来源:AddColumnsProcessedMetrics.php

示例3: filter

 /**
  * Filters the given data table
  *
  * @param DataTable $table
  */
 public function filter($table)
 {
     foreach ($table->getRows() as $key => $row) {
         $params = array();
         foreach ($this->columnsToFilter as $column) {
             $params[] = $row->getColumn($column);
         }
         $params = array_merge($params, $this->functionParams);
         if (call_user_func_array($this->function, $params) === true) {
             $table->deleteRow($key);
         }
         $this->filterSubTable($row);
     }
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:19,代码来源:ColumnCallbackDeleteRow.php

示例4: filter

 /**
  * See {@link PatternRecursive}.
  *
  * @param DataTable $table
  * @return int The number of deleted rows.
  */
 public function filter($table)
 {
     $rows = $table->getRows();
     foreach ($rows as $key => $row) {
         // A row is deleted if
         // 1 - its label doesnt contain the pattern
         // AND 2 - the label is not found in the children
         $patternNotFoundInChildren = false;
         $subTable = $row->getSubtable();
         if (!$subTable) {
             $patternNotFoundInChildren = true;
         } else {
             // we delete the row if we couldn't find the pattern in any row in the
             // children hierarchy
             if ($this->filter($subTable) == 0) {
                 $patternNotFoundInChildren = true;
             }
         }
         if ($patternNotFoundInChildren && !Pattern::match($this->patternToSearchQuoted, $row->getColumn($this->columnToFilter), $invertedMatch = false)) {
             $table->deleteRow($key);
         }
     }
     return $table->getRowsCount();
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:30,代码来源:PatternRecursive.php

示例5: nestedSearch

 private function nestedSearch(DataTable $sitesByGroup, $pattern)
 {
     foreach ($sitesByGroup->getRows() as $index => $site) {
         $label = strtolower($site->getColumn('label'));
         $labelMatches = false !== strpos($label, $pattern);
         if ($site->getMetadata('isGroup')) {
             $subtable = $site->getSubtable();
             $this->nestedSearch($subtable, $pattern);
             if (!$labelMatches && !$subtable->getRowsCount()) {
                 // we keep the group if at least one site within the group matches the pattern
                 $sitesByGroup->deleteRow($index);
             }
         } elseif (!$labelMatches) {
             $group = $site->getMetadata('group');
             if (!$group || false === strpos(strtolower($group), $pattern)) {
                 $sitesByGroup->deleteRow($index);
             }
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:20,代码来源:Dashboard.php

示例6: filterOutKeywordNotDefined

 /**
  * @param DataTable $table
  */
 private function filterOutKeywordNotDefined($table)
 {
     if ($table instanceof DataTable) {
         $row = $table->getRowIdFromLabel('');
         if ($row) {
             $table->deleteRow($row);
         }
     }
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:12,代码来源:API.php

示例7: filter

 /**
  * See {@link Pattern}.
  *
  * @param DataTable $table
  */
 public function filter($table)
 {
     foreach ($table->getRows() as $key => $row) {
         //instead search must handle
         // - negative search with -piwik
         // - exact match with ""
         // see (?!pattern) 	A subexpression that performs a negative lookahead search, which matches the search string at any point where a string not matching pattern begins.
         $value = $row->getColumn($this->columnToFilter);
         if ($value === false) {
             $value = $row->getMetadata($this->columnToFilter);
         }
         if (!self::match($this->patternToSearchQuoted, $value, $this->invertedMatch)) {
             $table->deleteRow($key);
         }
     }
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:21,代码来源:Pattern.php

示例8: deleteRowsWithNoVisit

 private function deleteRowsWithNoVisit(DataTable $table)
 {
     $metrics = new Metrics\Processed();
     foreach ($table->getRows() as $key => $row) {
         $nbVisits = $metrics->getColumn($row, Metrics::INDEX_NB_VISITS);
         $nbActions = $metrics->getColumn($row, Metrics::INDEX_NB_ACTIONS);
         if ($nbVisits == 0 && $nbActions == 0) {
             // case of keyword/website/campaign with a conversion for this day, but no visit, we don't show it
             $table->deleteRow($key);
         }
     }
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:12,代码来源:AddColumnsProcessedMetrics.php


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