當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。