/** * Initialize aggregator instance * This step is required * @param AW_Advancedreports_Block_Advanced_Grid $grid Active grid * @param string $type 'list' or 'periods' * @param string $aggId Id of report * @param string $timeType 'created at' or 'updated_at' * @return AW_Advancedreports_Helper_Tools_Aggregator */ public function initAggregator($grid = null, $type = null, $aggId = null, $timeType = null) { if ($aggId) { $this->_reportId = $aggId; } if ($type) { $this->_type = $type; } if ($timeType) { $this->_timeType = $timeType; } if ($grid) { $this->_grid = $grid; $this->_values = $grid->getOptionsValues(); } $this->_init = true; return $this; }