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\Customer\CustomerDependencyProvider as SprykerCustomerDependencyProvider; |
16
|
|
|
use Spryker\Zed\CustomerDataChangeRequest\Communication\Plugin\Customer\EmailChangeRequestSendVerificationCustomerPreUpdatePlugin; |
17
|
|
|
use Spryker\Zed\CustomerGroup\Communication\Plugin\CustomerAnonymizer\RemoveCustomerFromGroupPlugin; |
18
|
|
|
use Spryker\Zed\CustomerUserConnector\Communication\Plugin\CustomerTransferUsernameExpanderPlugin; |
19
|
|
|
use Spryker\Zed\Kernel\Container; |
20
|
|
|
use Spryker\Zed\Newsletter\Communication\Plugin\CustomerAnonymizer\CustomerUnsubscribePlugin; |
21
|
|
|
|
22
|
|
|
class CustomerDependencyProvider extends SprykerCustomerDependencyProvider |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @var string |
26
|
|
|
*/ |
27
|
|
|
public const SALES_FACADE = 'sales facade'; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
public const NEWSLETTER_FACADE = 'newsletter facade'; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
36
|
|
|
* |
37
|
|
|
* @return \Spryker\Zed\Kernel\Container |
38
|
|
|
*/ |
39
|
|
|
public function provideCommunicationLayerDependencies(Container $container): Container |
40
|
|
|
{ |
41
|
|
|
$container = parent::provideCommunicationLayerDependencies($container); |
42
|
|
|
|
43
|
|
|
$container->set(static::SALES_FACADE, function (Container $container) { |
44
|
|
|
return $container->getLocator()->sales()->facade(); |
45
|
|
|
}); |
46
|
|
|
|
47
|
|
|
$container->set(static::NEWSLETTER_FACADE, function (Container $container) { |
48
|
|
|
return $container->getLocator()->newsletter()->facade(); |
49
|
|
|
}); |
50
|
|
|
|
51
|
|
|
return $container; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return array<\Spryker\Zed\Customer\Dependency\Plugin\CustomerAnonymizerPluginInterface> |
56
|
|
|
*/ |
57
|
|
|
protected function getCustomerAnonymizerPlugins(): array |
58
|
|
|
{ |
59
|
|
|
return [ |
60
|
|
|
new CustomerUnsubscribePlugin([ |
61
|
|
|
NewsletterConstants::DEFAULT_NEWSLETTER_TYPE, |
62
|
|
|
]), |
63
|
|
|
new RemoveCustomerFromGroupPlugin(), |
64
|
|
|
new AvailabilityNotificationAnonymizerPlugin(), |
65
|
|
|
]; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return array<\Spryker\Zed\Customer\Dependency\Plugin\CustomerTransferExpanderPluginInterface> |
70
|
|
|
*/ |
71
|
|
|
protected function getCustomerTransferExpanderPlugins(): array |
72
|
|
|
{ |
73
|
|
|
return [ |
74
|
|
|
new CustomerTransferUsernameExpanderPlugin(), |
75
|
|
|
new AvailabilityNotificationSubscriptionCustomerTransferExpanderPlugin(), |
76
|
|
|
]; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @return array<\Spryker\Zed\CustomerExtension\Dependency\Plugin\CustomerPreUpdatePluginInterface> |
81
|
|
|
*/ |
82
|
|
|
protected function getCustomerPreUpdatePlugins(): array |
83
|
|
|
{ |
84
|
|
|
return [ |
85
|
|
|
new EmailChangeRequestSendVerificationCustomerPreUpdatePlugin(), |
86
|
|
|
]; |
87
|
|
|
} |
88
|
|
|
} |
89
|
|
|
|