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


PHP Piwik_DataTable_Manager类代码示例

本文整理汇总了PHP中Piwik_DataTable_Manager的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_DataTable_Manager类的具体用法?PHP Piwik_DataTable_Manager怎么用?PHP Piwik_DataTable_Manager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     Piwik::createConfigObject();
     Piwik_Config::getInstance()->setTestEnvironment();
     Piwik_DataTable_Manager::getInstance()->deleteAll();
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:7,代码来源:Array.test.php

示例2: getInstance

 /**
  * Returns instance
  *
  * @return Piwik_DataTable_Manager
  */
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:12,代码来源:Manager.php

示例3: filter

 protected function filter($table = null)
 {
     if (is_null($table)) {
         $table = $this->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 = Piwik_DataTable_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 && !Piwik_DataTable_Filter_Pattern::match($this->patternToSearch, $this->patternToSearchQuoted, $row->getColumn($this->columnToFilter))) {
             $table->deleteRow($key);
         }
     }
     return $table->getRowsCount();
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:29,代码来源:PatternRecursive.php

示例4: getInstance

 /**
  * Returns instance
  *
  * @return Piwik_DataTable_Manager
  */
 public static function getInstance()
 {
     if (self::$instance == null) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:13,代码来源:Manager.php

示例5: recalculate

 /**
  * Reset this row to an empty one and sum the associated subtable again.
  */
 public function recalculate()
 {
     $id = $this->getIdSubDataTable();
     if ($id !== null) {
         $subtable = Piwik_DataTable_Manager::getInstance()->getTable($id);
         $this->sumTable($subtable);
     }
 }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:11,代码来源:DataTableSummary.php

示例6: filterSubTable

 /**
  * Filters a subtable
  *
  * @param Piwik_DataTable_Row  $row
  * @return mixed
  */
 public function filterSubTable(Piwik_DataTable_Row $row)
 {
     if (!$this->enableRecursive) {
         return;
     }
     if ($row->isSubtableLoaded()) {
         $subTable = Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable());
         $this->filter($subTable);
     }
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:16,代码来源:Filter.php

示例7: tearDown

 public function tearDown()
 {
     parent::tearDown();
     Piwik_DataTable_Manager::getInstance()->deleteAll();
     Piwik_Option::getInstance()->clearCache();
     Piwik_Common::deleteTrackerCache();
     Piwik_Site::clearCache();
     Piwik::truncateAllTables();
     Piwik_TablePartitioning::$tablesAlreadyInstalled = null;
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:10,代码来源:Database.test.php

示例8: tearDown

 public function tearDown()
 {
     parent::tearDown();
     Piwik_DataTable_Manager::getInstance()->deleteAll();
     Piwik_Option::getInstance()->clearCache();
     Piwik_Site::clearCache();
     Piwik_Common::deleteTrackerCache();
     Piwik_TablePartitioning::$tablesAlreadyInstalled = null;
     $tempTableName = Piwik_Common::prefixTable(Piwik_PrivacyManager_LogDataPurger::TEMP_TABLE_NAME);
     Piwik_Query("DROP TABLE IF EXISTS " . $tempTableName);
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:11,代码来源:PrivacyManagerTest.php

示例9: filterSubTable

 public function filterSubTable(Piwik_DataTable_Row $row)
 {
     if (!$this->enableRecursive) {
         return;
     }
     try {
         $subTable = Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable());
         $this->filter($subTable);
     } catch (Exception $e) {
         // case idSubTable == null, or if the table is not loaded in memory
     }
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:12,代码来源:Filter.php

示例10: filterTable

 protected function filterTable($table)
 {
     foreach ($table->getRows() as $key => $row) {
         $this->renameColumns($row);
         try {
             $subTable = Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable());
             $this->filterTable($subTable);
         } catch (Exception $e) {
             // case idSubTable == null, or if the table is not loaded in memory
         }
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:12,代码来源:ReplaceColumnNames.php

示例11: filter

 /**
  * Truncates the table after X rows and adds a summary row
  *
  * @param Piwik_DataTable  $table
  */
 public function filter($table)
 {
     $table->filter('AddSummaryRow', array($this->truncateAfter));
     $table->filter('ReplaceSummaryRowLabel');
     foreach ($table->getRows() as $row) {
         if ($row->isSubtableLoaded()) {
             $idSubTable = $row->getIdSubDataTable();
             $subTable = Piwik_DataTable_Manager::getInstance()->getTable($idSubTable);
             $subTable->filter('Truncate', array($this->truncateAfter));
         }
     }
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:17,代码来源:Truncate.php

示例12: filter

 public function filter($table)
 {
     $table->filter('AddSummaryRow', array($this->truncateAfter));
     $table->filter('ReplaceSummaryRowLabel');
     foreach ($table->getRows() as $row) {
         try {
             $idSubTable = $row->getIdSubDataTable();
             $subTable = Piwik_DataTable_Manager::getInstance()->getTable($idSubTable);
             $subTable->filter('Truncate', array($this->truncateAfter));
         } catch (Exception $e) {
             // there is no subtable loaded for example
         }
     }
 }
开发者ID:neolf,项目名称:PIWIK4MOBILE,代码行数:14,代码来源:Truncate.php

示例13: renderTable

 protected function renderTable($table)
 {
     if ($table instanceof Piwik_DataTable_Array) {
         $output = '';
         $output .= "Piwik_DataTable_Array<hr>";
         foreach ($table->getArray() as $descTable => $table) {
             $output .= "<b>" . $descTable . "</b><br>";
             $output .= $table;
             $output .= "<hr>";
         }
         return $output;
     }
     if ($table->getRowsCount() == 0) {
         return "Empty table <br>\n";
     }
     static $depth = 0;
     $output = '';
     $i = 1;
     foreach ($table->getRows() as $row) {
         $columns = array();
         foreach ($row->getColumns() as $column => $value) {
             if (is_string($value)) {
                 $value = "'{$value}'";
             }
             $columns[] = "'{$column}' => {$value}";
         }
         $columns = implode(", ", $columns);
         $details = array();
         foreach ($row->getDetails() as $detail => $value) {
             if (is_string($value)) {
                 $value = "'{$value}'";
             }
             $details[] = "'{$detail}' => {$value}";
         }
         $details = implode(", ", $details);
         $output .= str_repeat($this->prefixRows, $depth) . "- {$i} [" . $columns . "] [" . $details . "] [idsubtable = " . $row->getIdSubDataTable() . "]<br>\n";
         if ($row->getIdSubDataTable() !== null) {
             $depth++;
             try {
                 $output .= $this->renderTable(Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable()));
             } catch (Exception $e) {
                 $output .= "-- Sub DataTable not loaded<br>\n";
             }
             $depth--;
         }
         $i++;
     }
     return $output;
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:49,代码来源:Console.php

示例14: filterTable

 protected function filterTable($table)
 {
     foreach ($table->getRows() as $key => $row) {
         $oldColumns = $row->getColumns();
         $newColumns = $this->getRenamedColumns($oldColumns);
         $row->setColumns($newColumns);
         if ($this->applyFilterRecursively) {
             try {
                 $subTable = Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable());
                 $this->filterTable($subTable);
             } catch (Exception $e) {
                 // case idSubTable == null, or if the table is not loaded in memory
             }
         }
     }
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:16,代码来源:ReplaceColumnNames.php

示例15: filter

 /**
  * Updates the summary row label
  *
  * @param Piwik_DataTable  $table
  */
 public function filter($table)
 {
     $rows = $table->getRows();
     foreach ($rows as $row) {
         if ($row->getColumn('label') == Piwik_DataTable::LABEL_SUMMARY_ROW) {
             $row->setColumn('label', $this->newLabel);
             break;
         }
     }
     // recurse
     foreach ($rows as $row) {
         if ($row->isSubtableLoaded()) {
             $subTable = Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable());
             $this->filter($subTable);
         }
     }
 }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:22,代码来源:ReplaceSummaryRowLabel.php


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