當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik_DataTable_Manager::getInstance方法代碼示例

本文整理匯總了PHP中Piwik_DataTable_Manager::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik_DataTable_Manager::getInstance方法的具體用法?PHP Piwik_DataTable_Manager::getInstance怎麽用?PHP Piwik_DataTable_Manager::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik_DataTable_Manager的用法示例。


在下文中一共展示了Piwik_DataTable_Manager::getInstance方法的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: tearDown

 /**
  * Resets all caches and drops the database
  */
 public function tearDown()
 {
     parent::tearDown();
     try {
         $plugins = Piwik_PluginsManager::getInstance()->getLoadedPlugins();
         foreach ($plugins as $plugin) {
             $plugin->uninstall();
         }
         Piwik_PluginsManager::getInstance()->unloadPlugins();
     } catch (Exception $e) {
     }
     Piwik::dropDatabase();
     Piwik_DataTable_Manager::getInstance()->deleteAll();
     Piwik_Option::getInstance()->clearCache();
     Piwik_Site::clearCache();
     Piwik_Common::deleteTrackerCache();
     Piwik_Config::getInstance()->clear();
     Piwik_TablePartitioning::$tablesAlreadyInstalled = null;
     Zend_Registry::_unsetInstance();
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:23,代碼來源:DatabaseTestCase.php

示例15: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     try {
         $plugins = Piwik_PluginsManager::getInstance()->getLoadedPlugins();
         foreach ($plugins as $plugin) {
             $plugin->uninstall();
         }
         Piwik_PluginsManager::getInstance()->unloadPlugins();
     } catch (Exception $e) {
     }
     Piwik::dropDatabase();
     Piwik_DataTable_Manager::getInstance()->deleteAll();
     Piwik_Option::getInstance()->clearCache();
     Piwik_Site::clearCache();
     Piwik_Common::deleteTrackerCache();
     Piwik_Config::getInstance()->clear();
     Piwik_TablePartitioning::$tablesAlreadyInstalled = null;
     Zend_Registry::_unsetInstance();
     $_GET = $_REQUEST = array();
     Piwik_Translate::getInstance()->unloadEnglishTranslation();
     // re-enable tag cloud shuffling
     Piwik_Visualization_Cloud::$debugDisableShuffle = true;
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:23,代碼來源:IntegrationTestCase.php


注:本文中的Piwik_DataTable_Manager::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。