本文整理汇总了PHP中Piwik\DataTable\Row::setSubtable方法的典型用法代码示例。如果您正苦于以下问题:PHP Row::setSubtable方法的具体用法?PHP Row::setSubtable怎么用?PHP Row::setSubtable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\DataTable\Row
的用法示例。
在下文中一共展示了Row::setSubtable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSubDataTableIsDestructed
/**
* @group Core
*/
public function testSubDataTableIsDestructed()
{
$mockedDataTable = $this->getMock('\\Piwik\\DataTable', array('__destruct'));
$mockedDataTable->expects($this->once())->method('__destruct');
$rowBeingDestructed = new Row();
$rowBeingDestructed->setSubtable($mockedDataTable);
Common::destroy($rowBeingDestructed);
}
示例2: generateDataTableWithManySubtables
private function generateDataTableWithManySubtables($numSubtables)
{
$dataTable = new DataTable();
for ($i = 1; $i <= $numSubtables; $i++) {
$row = new Row(array(Row::COLUMNS => array('label' => 'Label Test ' . $i, 'nb_visits' => $i)));
$subtable = DataTable::makeFromSimpleArray(array(array('label' => 'subtable' . $i, 'nb_visits' => $i)));
$row->setSubtable($subtable);
$dataTable->addRow($row);
}
return $dataTable->getSerialized();
}
示例3: getTableToFilter
private function getTableToFilter($addSubtables = false)
{
$row1 = new Row(array(Row::COLUMNS => array('label' => 'row 1', 'nb_visits' => 10, 'nb_actions' => 15)));
if ($addSubtables) {
$row1->setSubtable($this->getRow1Subtable());
}
$row2 = new Row(array(Row::COLUMNS => array('label' => 'row 2', 'nb_visits' => 13, 'nb_actions' => 18)));
if ($addSubtables) {
$row2->setSubtable($this->getRow2Subtable());
}
$row3 = new Row(array(Row::COLUMNS => array('label' => 'row 3', 'nb_visits' => 20, 'nb_actions' => 25)));
if ($addSubtables) {
$row3->setSubtable($this->getRow3Subtable());
}
$table = new DataTable();
$table->addRowsFromArray(array($row1, $row2, $row3));
return $table;
}