1 | <?php |
||
10 | class B2bConfigurableAddOrReplaceStrategy extends ConfigurableAddOrReplaceStrategy |
||
11 | { |
||
12 | /** |
||
13 | * Save state about exists Billing Address value in entity or not. |
||
14 | * Value is updated in function beforeProcessEntity and used |
||
15 | * in function afterProcessEntity |
||
16 | * |
||
17 | * @var bool |
||
18 | */ |
||
19 | protected $isBillingAddress = true; |
||
20 | |||
21 | /** |
||
22 | * Save state about exists Shipping Address value in entity or not. |
||
23 | * Value is updated in function beforeProcessEntity and used |
||
24 | * in function afterProcessEntity |
||
25 | * |
||
26 | * @var bool |
||
27 | */ |
||
28 | protected $isShippingAddress = true; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | protected function beforeProcessEntity($entity) |
||
34 | { |
||
35 | /** @var B2bCustomer $entity */ |
||
36 | $entity = parent::beforeProcessEntity($entity); |
||
37 | $this->checkEmptyAddresses($entity); |
||
38 | |||
39 | return $entity; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | protected function afterProcessEntity($entity) |
||
56 | |||
57 | /** |
||
58 | * @param B2bCustomer $entity |
||
59 | */ |
||
60 | protected function checkEmptyAddresses(B2bCustomer $entity) |
||
70 | |||
71 | /** |
||
72 | * @param B2bCustomer $entity |
||
73 | */ |
||
74 | protected function clearEmptyAddresses(B2bCustomer $entity) |
||
84 | |||
85 | /** |
||
86 | * @param Address $address |
||
87 | */ |
||
88 | protected function guessRegion($address) |
||
107 | } |
||
108 |