1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the Spryker Commerce OS. |
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
declare(strict_types = 1); |
9
|
|
|
|
10
|
|
|
namespace Pyz\Zed\Customer; |
11
|
|
|
|
12
|
|
|
use Spryker\Shared\Newsletter\NewsletterConstants; |
13
|
|
|
use Spryker\Zed\AvailabilityNotification\Communication\Plugin\Customer\AvailabilityNotificationSubscriptionCustomerTransferExpanderPlugin; |
14
|
|
|
use Spryker\Zed\AvailabilityNotification\Communication\Plugin\CustomerAnonymizer\AvailabilityNotificationAnonymizerPlugin; |
15
|
|
|
use Spryker\Zed\BusinessOnBehalf\Communication\Plugin\Customer\DefaultCompanyUserCustomerTransferExpanderPlugin; |
16
|
|
|
use Spryker\Zed\BusinessOnBehalf\Communication\Plugin\Customer\IsOnBehalfCustomerTransferExpanderPlugin; |
17
|
|
|
use Spryker\Zed\BusinessOnBehalfGui\Communication\Plugin\Customer\BusinessOnBehalfGuiAttachToCompanyButtonCustomerTableActionExpanderPlugin; |
18
|
|
|
use Spryker\Zed\CompanyRole\Communication\Plugin\PermissionCustomerExpanderPlugin; |
19
|
|
|
use Spryker\Zed\CompanyUser\Communication\Plugin\Customer\CompanyUserReloadCustomerTransferExpanderPlugin; |
20
|
|
|
use Spryker\Zed\CompanyUser\Communication\Plugin\Customer\CustomerTransferCompanyUserExpanderPlugin; |
21
|
|
|
use Spryker\Zed\CompanyUser\Communication\Plugin\Customer\IsActiveCompanyUserExistsCustomerTransferExpanderPlugin; |
22
|
|
|
use Spryker\Zed\CompanyUserGui\Communication\Plugin\Customer\CompanyUserCustomerTableActionExpanderPlugin; |
23
|
|
|
use Spryker\Zed\CompanyUserInvitation\Communication\Plugin\CompanyUserInvitationPostCustomerRegistrationPlugin; |
24
|
|
|
use Spryker\Zed\Customer\CustomerDependencyProvider as SprykerCustomerDependencyProvider; |
25
|
|
|
use Spryker\Zed\CustomerDataChangeRequest\Communication\Plugin\Customer\EmailChangeRequestSendVerificationCustomerPreUpdatePlugin; |
26
|
|
|
use Spryker\Zed\CustomerGroup\Communication\Plugin\CustomerAnonymizer\RemoveCustomerFromGroupPlugin; |
27
|
|
|
use Spryker\Zed\CustomerUserConnector\Communication\Plugin\CustomerTransferUsernameExpanderPlugin; |
28
|
|
|
use Spryker\Zed\Kernel\Container; |
29
|
|
|
use Spryker\Zed\MerchantRelationshipProductList\Communication\Plugin\Customer\ProductListCustomerTransferExpanderPlugin; |
30
|
|
|
use Spryker\Zed\Newsletter\Communication\Plugin\CustomerAnonymizer\CustomerUnsubscribePlugin; |
31
|
|
|
use Spryker\Zed\SharedCart\Communication\Plugin\QuotePermissionCustomerExpanderPlugin; |
32
|
|
|
use Spryker\Zed\ShoppingList\Communication\Plugin\ShoppingListPermissionCustomerExpanderPlugin; |
33
|
|
|
|
34
|
|
|
class CustomerDependencyProvider extends SprykerCustomerDependencyProvider |
35
|
|
|
{ |
36
|
|
|
/** |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
public const FACADE_SALES = 'sales facade'; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var string |
43
|
|
|
*/ |
44
|
|
|
public const FACADE_NEWSLETTER = 'newsletter facade'; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
48
|
|
|
* |
49
|
|
|
* @return \Spryker\Zed\Kernel\Container |
50
|
|
|
*/ |
51
|
|
|
public function provideCommunicationLayerDependencies(Container $container): Container |
52
|
|
|
{ |
53
|
|
|
$container = parent::provideCommunicationLayerDependencies($container); |
54
|
|
|
$container = $this->addFacadeSales($container); |
55
|
|
|
$container = $this->addFacadeNewsletter($container); |
56
|
|
|
|
57
|
|
|
return $container; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
62
|
|
|
* |
63
|
|
|
* @return \Spryker\Zed\Kernel\Container |
64
|
|
|
*/ |
65
|
|
|
protected function addFacadeSales(Container $container): Container |
66
|
|
|
{ |
67
|
|
|
$container->set(static::FACADE_SALES, function (Container $container) { |
68
|
|
|
return $container->getLocator()->sales()->facade(); |
69
|
|
|
}); |
70
|
|
|
|
71
|
|
|
return $container; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
76
|
|
|
* |
77
|
|
|
* @return \Spryker\Zed\Kernel\Container |
78
|
|
|
*/ |
79
|
|
|
protected function addFacadeNewsletter(Container $container): Container |
80
|
|
|
{ |
81
|
|
|
$container->set(static::FACADE_NEWSLETTER, function (Container $container) { |
82
|
|
|
return $container->getLocator()->newsletter()->facade(); |
83
|
|
|
}); |
84
|
|
|
|
85
|
|
|
return $container; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return array<\Spryker\Zed\Customer\Dependency\Plugin\CustomerAnonymizerPluginInterface> |
90
|
|
|
*/ |
91
|
|
|
protected function getCustomerAnonymizerPlugins(): array |
92
|
|
|
{ |
93
|
|
|
return [ |
94
|
|
|
new CustomerUnsubscribePlugin([ |
95
|
|
|
NewsletterConstants::DEFAULT_NEWSLETTER_TYPE, |
96
|
|
|
]), |
97
|
|
|
new RemoveCustomerFromGroupPlugin(), |
98
|
|
|
new AvailabilityNotificationAnonymizerPlugin(), |
99
|
|
|
]; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return array<\Spryker\Zed\Customer\Dependency\Plugin\CustomerTransferExpanderPluginInterface> |
104
|
|
|
*/ |
105
|
|
|
protected function getCustomerTransferExpanderPlugins(): array |
106
|
|
|
{ |
107
|
|
|
return [ |
108
|
|
|
new CustomerTransferUsernameExpanderPlugin(), |
109
|
|
|
new CompanyUserReloadCustomerTransferExpanderPlugin(), |
110
|
|
|
new CustomerTransferCompanyUserExpanderPlugin(), |
111
|
|
|
new IsActiveCompanyUserExistsCustomerTransferExpanderPlugin(), |
112
|
|
|
new PermissionCustomerExpanderPlugin(), |
113
|
|
|
new QuotePermissionCustomerExpanderPlugin(), #SharedCartFeature |
114
|
|
|
new ShoppingListPermissionCustomerExpanderPlugin(), |
115
|
|
|
new IsOnBehalfCustomerTransferExpanderPlugin(), #BusinessOnBefalfFeature |
116
|
|
|
new DefaultCompanyUserCustomerTransferExpanderPlugin(), #BusinessOnBefalfFeature |
117
|
|
|
new ProductListCustomerTransferExpanderPlugin(), |
118
|
|
|
new AvailabilityNotificationSubscriptionCustomerTransferExpanderPlugin(), |
119
|
|
|
]; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @return array<\Spryker\Zed\CustomerExtension\Dependency\Plugin\PostCustomerRegistrationPluginInterface> |
124
|
|
|
*/ |
125
|
|
|
protected function getPostCustomerRegistrationPlugins(): array |
126
|
|
|
{ |
127
|
|
|
return [ |
128
|
|
|
new CompanyUserInvitationPostCustomerRegistrationPlugin(), |
129
|
|
|
]; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @return array<\Spryker\Zed\CustomerExtension\Dependency\Plugin\CustomerTableActionExpanderPluginInterface> |
134
|
|
|
*/ |
135
|
|
|
protected function getCustomerTableActionExpanderPlugins(): array |
136
|
|
|
{ |
137
|
|
|
return [ |
138
|
|
|
new CompanyUserCustomerTableActionExpanderPlugin(), |
139
|
|
|
new BusinessOnBehalfGuiAttachToCompanyButtonCustomerTableActionExpanderPlugin(), |
140
|
|
|
]; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return array<\Spryker\Zed\CustomerExtension\Dependency\Plugin\CustomerPreUpdatePluginInterface> |
145
|
|
|
*/ |
146
|
|
|
protected function getCustomerPreUpdatePlugins(): array |
147
|
|
|
{ |
148
|
|
|
return [ |
149
|
|
|
new EmailChangeRequestSendVerificationCustomerPreUpdatePlugin(), |
150
|
|
|
]; |
151
|
|
|
} |
152
|
|
|
} |
153
|
|
|
|