本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例8: assertSegmentValues
private function assertSegmentValues($expectedSegmentValues)
{
$segmentValues = $this->table->getRowsMetadata('segmentValue');
$this->assertSame($expectedSegmentValues, $segmentValues);
}