1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
/** |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace CommerceLeague\ActiveCampaignApi; |
7
|
|
|
|
8
|
|
|
use CommerceLeague\ActiveCampaignApi\Api\AbandonedCartApiResourceInterface; |
9
|
|
|
use CommerceLeague\ActiveCampaignApi\Api\ConnectionApiResourceInterface; |
10
|
|
|
use CommerceLeague\ActiveCampaignApi\Api\ContactApiResourceInterface; |
11
|
|
|
use CommerceLeague\ActiveCampaignApi\Api\CustomerApiResourceInterface; |
12
|
|
|
use CommerceLeague\ActiveCampaignApi\Api\DealApiResourceInterface; |
13
|
|
|
use CommerceLeague\ActiveCampaignApi\Api\OrderApiResourceInterface; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Class CommonClient |
17
|
|
|
*/ |
18
|
|
|
class CommonClient implements CommonClientInterface |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @var AbandonedCartApiResourceInterface |
22
|
|
|
*/ |
23
|
|
|
private $abandonedCartApi; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var ConnectionApiResourceInterface |
27
|
|
|
*/ |
28
|
|
|
private $connectionApi; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var ContactApiResourceInterface |
32
|
|
|
*/ |
33
|
|
|
private $contactApi; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var CustomerApiResourceInterface |
37
|
|
|
*/ |
38
|
|
|
private $customerApi; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var DealApiResourceInterface |
42
|
|
|
*/ |
43
|
|
|
private $dealApi; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var OrderApiResourceInterface |
47
|
|
|
*/ |
48
|
|
|
private $orderApi; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param AbandonedCartApiResourceInterface $abandonedCartApi |
52
|
|
|
* @param ConnectionApiResourceInterface $connectionApi |
53
|
|
|
* @param ContactApiResourceInterface $contactApi |
54
|
|
|
* @param CustomerApiResourceInterface $customerApi |
55
|
|
|
* @param DealApiResourceInterface $dealApi |
56
|
|
|
* @param OrderApiResourceInterface $orderApi |
57
|
|
|
*/ |
58
|
|
|
public function __construct( |
59
|
|
|
AbandonedCartApiResourceInterface $abandonedCartApi, |
60
|
|
|
ConnectionApiResourceInterface $connectionApi, |
61
|
|
|
ContactApiResourceInterface $contactApi, |
62
|
|
|
CustomerApiResourceInterface $customerApi, |
63
|
|
|
DealApiResourceInterface $dealApi, |
64
|
|
|
OrderApiResourceInterface $orderApi |
65
|
|
|
) { |
66
|
|
|
$this->abandonedCartApi = $abandonedCartApi; |
67
|
|
|
$this->connectionApi = $connectionApi; |
68
|
|
|
$this->contactApi = $contactApi; |
69
|
|
|
$this->customerApi = $customerApi; |
70
|
|
|
$this->dealApi = $dealApi; |
71
|
|
|
$this->orderApi = $orderApi; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @inheritDoc |
76
|
|
|
*/ |
77
|
|
|
public function getAbandonedCartApi(): AbandonedCartApiResourceInterface |
78
|
|
|
{ |
79
|
|
|
return $this->abandonedCartApi; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @inheritDoc |
84
|
|
|
*/ |
85
|
|
|
public function getConnectionApi(): ConnectionApiResourceInterface |
86
|
|
|
{ |
87
|
|
|
return $this->connectionApi; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @inheritDoc |
92
|
|
|
*/ |
93
|
|
|
public function getContactApi(): ContactApiResourceInterface |
94
|
|
|
{ |
95
|
|
|
return $this->contactApi; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @inheritDoc |
100
|
|
|
*/ |
101
|
|
|
public function getCustomerApi(): CustomerApiResourceInterface |
102
|
|
|
{ |
103
|
|
|
return $this->customerApi; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @inheritDoc |
108
|
|
|
*/ |
109
|
|
|
public function getDealApi(): DealApiResourceInterface |
110
|
|
|
{ |
111
|
|
|
return $this->dealApi; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @inheritDoc |
116
|
|
|
*/ |
117
|
|
|
public function getOrderApi(): OrderApiResourceInterface |
118
|
|
|
{ |
119
|
|
|
return $this->orderApi; |
120
|
|
|
} |
121
|
|
|
} |
122
|
|
|
|