Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AggregateSalesReportRefundedData.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  protected $localeResolver;
20 
24  protected $localeDate;
25 
29  protected $refundedFactory;
30 
36  public function __construct(
38  TimezoneInterface $timezone,
39  \Magento\Sales\Model\ResourceModel\Report\RefundedFactory $refundedFactory
40  ) {
41  $this->localeResolver = $localeResolver;
42  $this->localeDate = $timezone;
43  $this->refundedFactory = $refundedFactory;
44  }
45 
51  public function execute()
52  {
53  $this->localeResolver->emulate(0);
54  $currentDate = $this->localeDate->date();
55  $date = $currentDate->sub(new \DateInterval('PT25H'));
56  $this->refundedFactory->create()->aggregate($date);
57  $this->localeResolver->revert();
58  }
59 }
__construct(ResolverInterface $localeResolver, TimezoneInterface $timezone, \Magento\Sales\Model\ResourceModel\Report\RefundedFactory $refundedFactory)