Piwik\Plugin\Report::init PHP Метод

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 ( )
    protected function init()
    {
    }

Usage Example

Пример #1
0
 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;
 }
All Usage Examples Of Piwik\Plugin\Report::init