本文整理汇总了PHP中Piwik_DataTable::setMaximumAllowedRows方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_DataTable::setMaximumAllowedRows方法的具体用法?PHP Piwik_DataTable::setMaximumAllowedRows怎么用?PHP Piwik_DataTable::setMaximumAllowedRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_DataTable
的用法示例。
在下文中一共展示了Piwik_DataTable::setMaximumAllowedRows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: walkPath
/**
* Traverses a DataTable tree using an array of labels and returns the row
* it finds or false if it cannot find one, and the number of segments of
* the path successfully walked.
*
* If $missingRowColumns is supplied, the specified path is created. When
* a subtable is encountered w/o the queried label, a new row is created
* with the label, and a subtable is added to the row.
*
* @param array $path The path to walk. An array of label values.
* @param array|false $missingRowColumns
* The default columns to use when creating new arrays.
* If this parameter is supplied, new rows will be
* created if labels cannot be found.
* @param int $maxSubtableRows The maximum number of allowed rows in new
* subtables.
* @return array First element is the found row or false. Second element is
* the number of path segments walked. If a row is found, this
* will be == to count($path). Otherwise, it will be the index
* of the path segment that we could not find.
*/
public function walkPath($path, $missingRowColumns = false, $maxSubtableRows = 0)
{
$pathLength = count($path);
$table = $this;
$next = false;
for ($i = 0; $i < $pathLength; ++$i) {
$segment = $path[$i];
$next = $table->getRowFromLabel($segment);
if ($next === false) {
// if there is no table to advance to, and we're not adding missing rows, return false
if ($missingRowColumns === false) {
return array(false, $i);
} else {
$row = new Piwik_DataTable_Row_DataTableSummary();
$row->setColumns(array('label' => $segment) + $missingRowColumns);
$next = $table->addRow($row);
if ($next !== $row) {
// Summary row, has no metadata
$next->deleteMetadata();
return array($next, $i);
}
}
}
$table = $next->getSubtable();
if ($table === false) {
// if the row has no table (and thus no child rows), and we're not adding
// missing rows, return false
if ($missingRowColumns === false) {
return array(false, $i);
} else {
if ($i != $pathLength - 1) {
$table = new Piwik_DataTable();
$table->setMaximumAllowedRows($maxSubtableRows);
$next->setSubtable($table);
// Summary row, has no metadata
$next->deleteMetadata();
}
}
}
}
return array($next, $i);
}
示例2: initActionsTables
/**
* Initializes the DataTables created by the archiveDay function.
*/
private function initActionsTables()
{
$this->actionsTablesByType = array();
foreach (self::$actionTypes as $type) {
$dataTable = new Piwik_DataTable();
$dataTable->setMaximumAllowedRows(Piwik_Actions_ArchivingHelper::$maximumRowsInDataTableLevelZero);
$this->actionsTablesByType[$type] = $dataTable;
}
}