1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Magium\Magento\Extractors\Admin; |
4
|
|
|
|
5
|
|
|
use Magium\Extractors\AbstractExtractor; |
6
|
|
|
use Magium\Magento\Extractors\Admin\Order\AccountInformation; |
7
|
|
|
use Magium\Magento\Extractors\Admin\Order\BillingAddress; |
8
|
|
|
use Magium\Magento\Extractors\Admin\Order\OrderItems; |
9
|
|
|
use Magium\Magento\Extractors\Admin\Order\OrderSummary; |
10
|
|
|
use Magium\Magento\Extractors\Admin\Order\PaymentInformation; |
11
|
|
|
use Magium\Magento\Extractors\Admin\Order\ShippingAddress; |
12
|
|
|
use Magium\Magento\Extractors\Admin\Order\ShippingInformation; |
13
|
|
|
use Magium\Magento\Extractors\Admin\Order\Totals; |
14
|
|
|
|
15
|
|
|
class OrderInformationExtractor extends AbstractExtractor |
16
|
|
|
{ |
17
|
|
|
const EXTRACTOR = 'Admin\OrderInformationExtractor'; |
18
|
|
|
protected $extractors = []; |
19
|
|
|
|
20
|
|
|
public function __construct( |
21
|
|
|
AccountInformation $accountInformation, |
22
|
|
|
BillingAddress $billingAddress, |
23
|
|
|
OrderItems $orderItems, |
24
|
|
|
OrderSummary $orderSummary, |
25
|
|
|
PaymentInformation $paymentInformation, |
26
|
|
|
ShippingAddress $shippingAddress, |
27
|
|
|
ShippingInformation $shippingInformation, |
28
|
|
|
Totals $totals |
29
|
|
|
) |
30
|
|
|
{ |
31
|
|
|
$this->extractors[] = $accountInformation; |
32
|
|
|
$this->extractors[] = $billingAddress; |
33
|
|
|
$this->extractors[] = $orderItems; |
34
|
|
|
$this->extractors[] = $orderSummary; |
35
|
|
|
$this->extractors[] = $paymentInformation; |
36
|
|
|
$this->extractors[] = $shippingAddress; |
37
|
|
|
$this->extractors[] = $shippingInformation; |
38
|
|
|
$this->extractors[] = $totals; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function extract() |
42
|
|
|
{ |
43
|
|
|
foreach ($this->extractors as $extractor) { |
44
|
|
|
if ($extractor instanceof AbstractExtractor) { |
45
|
|
|
$extractor->extract(); |
46
|
|
|
} |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
} |