init() 보호된 메소드

Here you can do any instance initialization and overwrite any default values. You should avoid doing time consuming initialization here and if possible delay as long as possible. An instance of this report will be created in most page requests.
protected init ( )
예제 #1
0
파일: Get.php 프로젝트: piwik/piwik
 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
0
파일: ReportTest.php 프로젝트: Abine/piwik
 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
0
 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
0
파일: Get.php 프로젝트: a4tunado/piwik
 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
0
파일: Get.php 프로젝트: JoeHorn/piwik
 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
0
 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;
 }
 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);
             }
         }
     }
 }