_createDatFactory = $createDatFactory; $this->_updateDatFactory = $updateDatFactory; } /** * Model initialization * * @return void */ protected function _construct() { $this->_init('sales_order_aggregated_created', 'id'); } /** * Aggregate Orders data * * @param string|int|\DateTime|array|null $from * @param string|int|\DateTime|array|null $to * @return $this */ public function aggregate($from = null, $to = null) { $this->_createDatFactory->create()->aggregate($from, $to); $this->_updateDatFactory->create()->aggregate($from, $to); $this->_setFlagData(\Magento\Reports\Model\Flag::REPORT_ORDER_FLAG_CODE); return $this; } }