本文整理匯總了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;
}