本文整理匯總了PHP中Piwik\Plugin\Report::getSubcategoryId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Report::getSubcategoryId方法的具體用法?PHP Report::getSubcategoryId怎麽用?PHP Report::getSubcategoryId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Plugin\Report
的用法示例。
在下文中一共展示了Report::getSubcategoryId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createContainerWidget
/**
* Creates a new container widget based on the specified report in {@link construct()}.
*
* It will automatically use the report's categoryId, subcategoryId (if specified) and order in order to
* create the container.
*
* @param string $containerId eg 'Products' or 'Contents' see {Piwik\Widget\WidgetContainerConfig::setId()}.
* Other reports or widgets will be able to add more widgets to this container.
* This is useful when you want to show for example multiple related widgets
* together.
* @return WidgetContainerConfig
*/
public function createContainerWidget($containerId)
{
$widget = new WidgetContainerConfig();
$widget->setCategoryId($this->report->getCategoryId());
$widget->setId($containerId);
if ($this->report->getSubcategoryId()) {
$widget->setSubcategoryId($this->report->getSubcategoryId());
}
$orderThatListsReportsAtTheEndOfEachCategory = 100 + $this->report->getOrder();
$widget->setOrder($orderThatListsReportsAtTheEndOfEachCategory);
return $widget;
}
示例2: sort
/**
* API metadata are sorted by category/name,
* with a little tweak to replicate the standard Piwik category ordering
*
* @param Report $a
* @param Report $b
* @return int
*/
private function sort($a, $b)
{
return $this->compareCategories($a->getCategoryId(), $a->getSubcategoryId(), $a->getOrder(), $b->getCategoryId(), $b->getSubcategoryId(), $b->getOrder());
}