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


PHP DataTable::getRowsMetadata方法代碼示例

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


在下文中一共展示了DataTable::getRowsMetadata方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_filter_shouldUrlEncodeValues

 public function test_filter_shouldUrlEncodeValues()
 {
     $mapping = array(1 => 'Core tests', 3 => 'plugins tästs');
     $this->table->filter($this->filter, array('segmentName', $mapping));
     $metadata = $this->table->getRowsMetadata('segment');
     $expected = array('segmentName==Core+tests', false, 'segmentName==plugins+t%C3%A4sts', false, false, false);
     $this->assertSame($expected, $metadata);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:8,代碼來源:AddSegmentFilterByLabelMappingTest.php

示例2: array

 public function test_filter_IfMultipleSegmentsAreGiven_IfShouldBePossibleToIgnorePartsByUsingAnEmptyStringAsSegmentName()
 {
     // must result in 3 exploded parts city, region and country
     $this->table->filter($this->filter, array(array('city', '', 'country'), $delimiter = ' '));
     $segmentValues = $this->table->getRowsMetadata('segment');
     $expected = array(false, false, false, false, false, 'city==play;country==movie', false, false);
     $this->assertSame($expected, $segmentValues);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:8,代碼來源:AddSegmentFilterTest.php

示例3: test_filter_shouldRemoveAllMetadataEntriesHavingTheGivenName_EvenIfOnlySomeRowsHaveThatMetadataName

 public function test_filter_shouldRemoveAllMetadataEntriesHavingTheGivenName_EvenIfOnlySomeRowsHaveThatMetadataName()
 {
     $this->table->filter($this->filter, array('other'));
     $metadata = $this->table->getRowsMetadata('other');
     $this->assertSame(array(false, false, false, false, false), $metadata);
     $metadata = $this->table->getRowsMetadata('test');
     $expected = array('1', '2', '3', '1', '4');
     $this->assertSame($expected, $metadata);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:9,代碼來源:ColumnCallbackDeleteMetadataTest.php

示例4: test_filter_shouldOnlyPrependIfAMetadataNameIsSet

 public function test_filter_shouldOnlyPrependIfAMetadataNameIsSet()
 {
     $this->table->filter($this->filter, array('other', 'prependme'));
     $metadata = $this->table->getRowsMetadata('other');
     $this->assertSame(array(false, 'prependmevalue', false, 'prependmevalue', 'prependme'), $metadata);
     // should still be the same
     $metadata = $this->table->getRowsMetadata('test');
     $this->assertSame(array('1', '2', '3', '1', '4'), $metadata);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:9,代碼來源:PrependValueToMetadataTest.php

示例5: test_filter_shouldRemoveAllMetadataEntriesHavingTheGivenName

 public function test_filter_shouldRemoveAllMetadataEntriesHavingTheGivenName()
 {
     $prepend = 'city=test;';
     $this->table->filter($this->filter, array($prepend));
     $metadata = $this->table->getRowsMetadata('segment');
     $this->assertSame(array(false, $prepend . 'country=NZ', false, $prepend . 'country=AU', $prepend), $metadata);
     // should be still the same
     $metadata = $this->table->getRowsMetadata('test');
     $this->assertSame(array('1', '2', '3', '1', '4'), $metadata);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:10,代碼來源:PrependSegmentFilterTest.php

示例6: test_filter_shouldNotGenerateASegmentValueIfReturnValueIsFalse

 public function test_filter_shouldNotGenerateASegmentValueIfReturnValueIsFalse()
 {
     $this->table->filter($this->filter, array(function ($label) {
         if ($label === false) {
             return 'was false';
         }
         return false;
     }));
     $segmentValues = $this->table->getRowsMetadata('segmentValue');
     $expected = array(false, false, false, false, 'was false', false, 'was false', false);
     $this->assertSame($expected, $segmentValues);
 }
開發者ID:mgou-net,項目名稱:piwik,代碼行數:12,代碼來源:AddSegmentValueTest.php

示例7: test_filter

 public function test_filter()
 {
     $dataTable = new DataTable();
     $dataTable->addRowsFromArray(array(array(Row::COLUMNS => array('label' => 'val1', 'nb_visits' => 120)), array(Row::COLUMNS => array('nb_visits' => 90)), array(Row::COLUMNS => array('label' => 'val2 5w ö?', 'nb_visits' => 99)), array(Row::COLUMNS => array('label' => Archiver::LABEL_CUSTOM_VALUE_NOT_DEFINED, 'nb_visits' => 99))));
     $dataTable->filter($this->filter, array($idDimension = 5));
     $metadata = $dataTable->getRowsMetadata('segment');
     $expected = array('dimension5==val1', false, 'dimension5==val2+5w+%C3%B6%3F', 'dimension5==');
     $this->assertSame($expected, $metadata);
 }
開發者ID:ep123,項目名稱:plugin-CustomDimensions,代碼行數:9,代碼來源:AddSegmentMetadataTest.php

示例8: assertSegmentValues

 private function assertSegmentValues($expectedSegmentValues)
 {
     $segmentValues = $this->table->getRowsMetadata('segmentValue');
     $this->assertSame($expectedSegmentValues, $segmentValues);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:5,代碼來源:AddSegmentByLabelInUTCTest.php


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