Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Tax.php
Go to the documentation of this file.
1 <?php
11 
13 {
17  protected $_createdAtFactory;
18 
22  protected $_updatedAtFactory;
23 
35  public function __construct(
36  \Magento\Framework\Model\ResourceModel\Db\Context $context,
37  \Psr\Log\LoggerInterface $logger,
38  \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
39  \Magento\Reports\Model\FlagFactory $reportsFlagFactory,
40  \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator,
41  \Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
42  \Magento\Tax\Model\ResourceModel\Report\Tax\CreatedatFactory $createdAtFactory,
43  \Magento\Tax\Model\ResourceModel\Report\Tax\UpdatedatFactory $updatedAtFactory,
44  $connectionName = null
45  ) {
46  $this->_createdAtFactory = $createdAtFactory;
47  $this->_updatedAtFactory = $updatedAtFactory;
48  parent::__construct(
49  $context,
50  $logger,
51  $localeDate,
52  $reportsFlagFactory,
53  $timezoneValidator,
54  $dateTime,
56  );
57  }
58 
64  protected function _construct()
65  {
66  $this->_init('tax_order_aggregated_created', 'id');
67  }
68 
76  public function aggregate($from = null, $to = null)
77  {
79  $createdAt = $this->_createdAtFactory->create();
81  $updatedAt = $this->_updatedAtFactory->create();
82 
83  $createdAt->aggregate($from, $to);
84  $updatedAt->aggregate($from, $to);
85  $this->_setFlagData(\Magento\Reports\Model\Flag::REPORT_TAX_FLAG_CODE);
86 
87  return $this;
88  }
89 }
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator, \Magento\Framework\Stdlib\DateTime\DateTime $dateTime, \Magento\Tax\Model\ResourceModel\Report\Tax\CreatedatFactory $createdAtFactory, \Magento\Tax\Model\ResourceModel\Report\Tax\UpdatedatFactory $updatedAtFactory, $connectionName=null)
Definition: Tax.php:35
$logger