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\OrderApiResourceInterface; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Class CommonClient |
16
|
|
|
*/ |
17
|
|
|
class CommonClient implements CommonClientInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var AbandonedCartApiResourceInterface |
21
|
|
|
*/ |
22
|
|
|
private $abandonedCartApi; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var ConnectionApiResourceInterface |
26
|
|
|
*/ |
27
|
|
|
private $connectionApi; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var ContactApiResourceInterface |
31
|
|
|
*/ |
32
|
|
|
private $contactApi; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var CustomerApiResourceInterface |
36
|
|
|
*/ |
37
|
|
|
private $customerApi; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var OrderApiResourceInterface |
41
|
|
|
*/ |
42
|
|
|
private $orderApi; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @param AbandonedCartApiResourceInterface $abandonedCartApi |
46
|
|
|
* @param ConnectionApiResourceInterface $connectionApi |
47
|
|
|
* @param ContactApiResourceInterface $contactApi |
48
|
|
|
* @param CustomerApiResourceInterface $customerApi |
49
|
|
|
* @param OrderApiResourceInterface $orderApi |
50
|
|
|
*/ |
51
|
|
|
public function __construct( |
52
|
|
|
AbandonedCartApiResourceInterface $abandonedCartApi, |
53
|
|
|
ConnectionApiResourceInterface $connectionApi, |
54
|
|
|
ContactApiResourceInterface $contactApi, |
55
|
|
|
CustomerApiResourceInterface $customerApi, |
56
|
|
|
OrderApiResourceInterface $orderApi |
57
|
|
|
) { |
58
|
|
|
$this->abandonedCartApi = $abandonedCartApi; |
59
|
|
|
$this->connectionApi = $connectionApi; |
60
|
|
|
$this->contactApi = $contactApi; |
61
|
|
|
$this->customerApi = $customerApi; |
62
|
|
|
$this->orderApi = $orderApi; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @inheritDoc |
67
|
|
|
*/ |
68
|
|
|
public function getAbandonedCartApi(): AbandonedCartApiResourceInterface |
69
|
|
|
{ |
70
|
|
|
return $this->abandonedCartApi; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @inheritDoc |
75
|
|
|
*/ |
76
|
|
|
public function getConnectionApi(): ConnectionApiResourceInterface |
77
|
|
|
{ |
78
|
|
|
return $this->connectionApi; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @inheritDoc |
83
|
|
|
*/ |
84
|
|
|
public function getContactApi(): ContactApiResourceInterface |
85
|
|
|
{ |
86
|
|
|
return $this->contactApi; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @inheritDoc |
91
|
|
|
*/ |
92
|
|
|
public function getCustomerApi(): CustomerApiResourceInterface |
93
|
|
|
{ |
94
|
|
|
return $this->customerApi; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @inheritDoc |
99
|
|
|
*/ |
100
|
|
|
public function getOrderApi(): OrderApiResourceInterface |
101
|
|
|
{ |
102
|
|
|
return $this->orderApi; |
103
|
|
|
} |
104
|
|
|
} |
105
|
|
|
|