本文整理汇总了PHP中Piwik\Plugin\Report::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::init方法的具体用法?PHP Report::init怎么用?PHP Report::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Plugin\Report
的用法示例。
在下文中一共展示了Report::init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
protected function init()
{
parent::init();
$this->reportsToMerge = $this->getReportsToMerge();
$this->module = 'API';
$this->action = 'get';
$this->categoryId = 'API';
$this->name = Piwik::translate('General_MainMetrics');
$this->documentation = '';
$this->processedMetrics = array();
foreach ($this->reportsToMerge as $report) {
if (!is_array($report->processedMetrics)) {
continue;
}
$this->processedMetrics = array_merge($this->processedMetrics, $report->processedMetrics);
}
$this->metrics = array();
foreach ($this->reportsToMerge as $report) {
if (!is_array($report->metrics)) {
continue;
}
$this->metrics = array_merge($this->metrics, $report->metrics);
}
$this->order = 6;
}
示例2: init
protected function init()
{
parent::init();
$this->name = 'My Custom Report Name';
$this->order = 20;
$this->module = 'TestPlugin';
$this->action = 'getBasicReport';
$this->category = 'Goals_Goals';
}
示例3: init
protected function init()
{
parent::init();
$this->category = 'General_Visitors';
$this->name = Piwik::translate('VisitFrequency_ColumnReturningVisits');
$this->documentation = '';
// TODO
$this->processedMetrics = array(new ReturningMetric(new AverageTimeOnSite()), new ReturningMetric(new ActionsPerVisit()), new ReturningMetric(new BounceRate()));
$this->metrics = array('nb_visits_returning', 'nb_actions_returning', 'nb_uniq_visitors_returning', 'nb_users_returning', 'max_actions_returning');
$this->order = 40;
}
示例4: init
protected function init()
{
parent::init();
$this->category = 'General_Visitors';
$this->name = Piwik::translate('VisitFrequency_ColumnReturningVisits');
$this->documentation = '';
// TODO
$this->metrics = array('nb_visits_returning', 'nb_actions_returning', 'avg_time_on_site_returning', 'bounce_rate_returning', 'nb_actions_per_visit_returning', 'nb_uniq_visitors_returning');
$this->processedMetrics = false;
$this->order = 40;
}
示例5: init
protected function init()
{
parent::init();
$this->category = 'VisitsSummary_VisitsSummary';
$this->name = Piwik::translate('VisitsSummary_VisitsSummary');
$this->documentation = '';
// TODO
$this->processedMetrics = array(new BounceRate(), new ActionsPerVisit(), new AverageTimeOnSite());
$this->metrics = array('nb_uniq_visitors', 'nb_visits', $this->usersColumn, 'nb_actions', 'max_actions');
// Used to process metrics, not displayed/used directly
// 'sum_visit_length',
// 'nb_visits_converted',
$this->order = 1;
}
示例6: init
protected function init()
{
parent::init();
$this->category = 'VisitsSummary_VisitsSummary';
$this->name = Piwik::translate('VisitsSummary_VisitsSummary');
$this->documentation = '';
// TODO
$this->processedMetrics = false;
$this->metrics = array('nb_uniq_visitors', 'nb_visits', 'nb_actions', 'nb_actions_per_visit', 'bounce_rate', 'avg_time_on_site', 'max_actions');
// Used to process metrics, not displayed/used directly
// 'sum_visit_length',
// 'nb_visits_converted',
$this->order = 1;
}
示例7: init
protected function init()
{
parent::init();
$this->categoryId = 'CustomDimensions_CustomDimensions';
$this->name = Piwik::translate($this->categoryId);
$this->order = 100;
$this->actionToLoadSubTables = $this->action;
$idDimension = Common::getRequestVar('idDimension', 0, 'int');
$idSite = Common::getRequestVar('idSite', 0, 'int');
if ($idDimension > 0 && $idSite > 0) {
$dimensions = $this->getActiveDimensionsForSite($idSite);
foreach ($dimensions as $dimension) {
if ((int) $dimension['idcustomdimension'] === $idDimension) {
$this->initThisReportFromDimension($dimension);
}
}
}
}