_createdAtFactory = $createdAtFactory; $this->_updatedAtFactory = $updatedAtFactory; parent::__construct( $context, $logger, $localeDate, $reportsFlagFactory, $timezoneValidator, $dateTime, $connectionName ); } /** * Resource initialization * * @return void */ protected function _construct() { $this->_init('tax_order_aggregated_created', 'id'); } /** * Aggregate Tax data * * @param mixed $from * @param mixed $to * @return $this */ public function aggregate($from = null, $to = null) { /** @var $createdAt \Magento\Tax\Model\ResourceModel\Report\Tax\Createdat */ $createdAt = $this->_createdAtFactory->create(); /** @var $updatedAt \Magento\Tax\Model\ResourceModel\Report\Tax\Updatedat */ $updatedAt = $this->_updatedAtFactory->create(); $createdAt->aggregate($from, $to); $updatedAt->aggregate($from, $to); $this->_setFlagData(\Magento\Reports\Model\Flag::REPORT_TAX_FLAG_CODE); return $this; } }