_reportsResourceHelper = $reportsResourceHelper; } /** * Update rating position * * @param string $aggregation One of BestsellersReport::AGGREGATION_XXX constants * @param array $aggregationAliases * @param string $mainTable * @param string $aggregationTable * @return $this */ public function getBestsellersReportUpdateRatingPos( $aggregation, $aggregationAliases, $mainTable, $aggregationTable ) { $connection = $this->_resource->getConnection('sales'); if ($aggregation == $aggregationAliases['monthly']) { $this->_reportsResourceHelper->updateReportRatingPos( $connection, 'month', 'qty_ordered', $mainTable, $aggregationTable ); } elseif ($aggregation == $aggregationAliases['yearly']) { $this->_reportsResourceHelper->updateReportRatingPos( $connection, 'year', 'qty_ordered', $mainTable, $aggregationTable ); } else { $this->_reportsResourceHelper->updateReportRatingPos( $connection, 'day', 'qty_ordered', $mainTable, $aggregationTable ); } return $this; } }