1 | <?php |
||
13 | class LeadService implements ServiceInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var RequestHandler |
||
17 | */ |
||
18 | protected $request; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $fields = []; |
||
24 | |||
25 | /** |
||
26 | * @var |
||
27 | */ |
||
28 | protected $response; |
||
29 | |||
30 | /** |
||
31 | * @var array Lead |
||
32 | */ |
||
33 | protected $leads = []; |
||
34 | |||
35 | /** |
||
36 | * LeadService constructor. |
||
37 | * @param RequestHandler $requestHandler |
||
38 | */ |
||
39 | 3 | public function __construct(RequestHandler $requestHandler) |
|
43 | |||
44 | /** |
||
45 | * @param Lead $lead |
||
46 | */ |
||
47 | 3 | public function add(EntityInterface $lead) |
|
53 | |||
54 | /** |
||
55 | * @return bool|mixed |
||
56 | */ |
||
57 | 3 | public function createLead() |
|
69 | |||
70 | /** |
||
71 | * @return mixed |
||
72 | */ |
||
73 | 2 | public function getResponse() |
|
77 | |||
78 | /** |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getLeads() |
||
85 | |||
86 | /** |
||
87 | * @return array|bool |
||
88 | */ |
||
89 | 2 | public function parseResponseToLeads() |
|
105 | |||
106 | /** |
||
107 | * @return bool |
||
108 | */ |
||
109 | 3 | protected function checkResponse() |
|
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | 3 | protected function getLink() |
|
125 | |||
126 | /** |
||
127 | * Fill fields for request |
||
128 | */ |
||
129 | 3 | protected function composeAddFields() |
|
139 | } |