本文整理汇总了PHP中Piwik_DataTable::getRowFromLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_DataTable::getRowFromLabel方法的具体用法?PHP Piwik_DataTable::getRowFromLabel怎么用?PHP Piwik_DataTable::getRowFromLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_DataTable
的用法示例。
在下文中一共展示了Piwik_DataTable::getRowFromLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isEqual
/**
* Returns true if both DataTable are exactly the same.
* Used in unit tests.
*
* @param Piwik_DataTable $table1
* @param Piwik_DataTable $table2
* @return bool
*/
public static function isEqual(Piwik_DataTable $table1, Piwik_DataTable $table2)
{
$rows1 = $table1->getRows();
$rows2 = $table2->getRows();
$table1->rebuildIndex();
$table2->rebuildIndex();
if ($table1->getRowsCount() != $table2->getRowsCount()) {
return false;
}
foreach ($rows1 as $row1) {
$row2 = $table2->getRowFromLabel($row1->getColumn('label'));
if ($row2 === false || !Piwik_DataTable_Row::isEqual($row1, $row2)) {
return false;
}
}
return true;
}
示例2: doFilterRecursiveDescend
/**
* Method for the recursive descend
*
* @param array $labelParts
* @param Piwik_DataTable $dataTable
* @param bool $date
* @return Piwik_DataTable_Row|false
*/
private function doFilterRecursiveDescend($labelParts, $dataTable, $date = false)
{
// search for the first part of the tree search
$labelPart = array_shift($labelParts);
foreach ($this->getLabelVariations($labelPart) as $labelPart) {
$row = $dataTable->getRowFromLabel($labelPart);
if ($row !== false) {
break;
}
}
if ($row === false) {
// not found
return false;
}
// end of tree search reached
if (count($labelParts) == 0) {
return $row;
}
$subTable = $this->loadSubtable($row, $date);
if ($subTable === null) {
// no more subtables but label parts left => no match found
return false;
}
return $this->doFilterRecursiveDescend($labelParts, $subTable, $date);
}