1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author Dmitry Gladyshev <[email protected]> |
4
|
|
|
* @created 03.12.16 15:26 |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
namespace Gladyshev\Yandex\Direct\Service; |
8
|
|
|
|
9
|
|
|
|
10
|
|
|
|
11
|
|
|
use function Gladyshev\Yandex\Direct\get_param_names; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Class RetargetingLists |
15
|
|
|
* @package Gladyshev\Yandex\Direct\Service |
16
|
|
|
*/ |
17
|
|
|
final class RetargetingLists extends \Gladyshev\Yandex\Direct\AbstractService |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* Создает условия подбора аудитории. |
21
|
|
|
* |
22
|
|
|
* @param $RetargetingLists |
23
|
|
|
* @return array |
24
|
|
|
* @throws \Throwable |
25
|
|
|
* |
26
|
|
|
* @see https://tech.yandex.ru/direct/doc/ref-v5/retargetinglists/add-docpage/ |
27
|
|
|
|
28
|
|
|
*/ |
29
|
|
|
public function add($RetargetingLists) |
30
|
|
|
{ |
31
|
|
|
return $this->call([ |
32
|
|
|
'method' => 'get', |
33
|
|
|
'params' => [ |
34
|
|
|
'RetargetingLists' => $RetargetingLists |
35
|
|
|
] |
36
|
|
|
]); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Удаляет условия подбора аудитории. |
41
|
|
|
* |
42
|
|
|
* @param $SelectionCriteria |
43
|
|
|
* @return array |
44
|
|
|
* @throws \Throwable |
45
|
|
|
* |
46
|
|
|
* @see https://tech.yandex.ru/direct/doc/ref-v5/retargetinglists/delete-docpage/ |
47
|
|
|
*/ |
48
|
|
|
public function delete($SelectionCriteria) |
49
|
|
|
{ |
50
|
|
|
return $this->call([ |
51
|
|
|
'method' => 'delete', |
52
|
|
|
'params' => [ |
53
|
|
|
'SelectionCriteria' => $SelectionCriteria |
54
|
|
|
] |
55
|
|
|
]); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Возвращает условия подбора аудитории. |
60
|
|
|
* |
61
|
|
|
* @param $SelectionCriteria |
62
|
|
|
* @param $FieldNames |
63
|
|
|
* @param $Page |
64
|
|
|
* @return array |
65
|
|
|
* @throws \Throwable |
66
|
|
|
* @throws \ReflectionException |
67
|
|
|
* |
68
|
|
|
* @see https://tech.yandex.ru/direct/doc/ref-v5/retargetinglists/get-docpage/ |
69
|
|
|
*/ |
70
|
|
|
public function get($SelectionCriteria, $FieldNames, $Page = null) |
71
|
|
|
{ |
72
|
|
|
$params = compact(get_param_names(__METHOD__)); |
73
|
|
|
|
74
|
|
|
return $this->call([ |
75
|
|
|
'method' => 'get', |
76
|
|
|
'params' => $params |
77
|
|
|
]); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Изменяет параметры условий подбора аудитории. |
82
|
|
|
* |
83
|
|
|
* @param $RetargetingLists |
84
|
|
|
* @return array |
85
|
|
|
* @throws \Throwable |
86
|
|
|
* |
87
|
|
|
* @see https://tech.yandex.ru/direct/doc/ref-v5/retargetinglists/update-docpage/ |
88
|
|
|
*/ |
89
|
|
|
public function update($RetargetingLists) |
90
|
|
|
{ |
91
|
|
|
return $this->call([ |
92
|
|
|
'method' => 'update', |
93
|
|
|
'params' => [ |
94
|
|
|
'RetargetingLists' => $RetargetingLists |
95
|
|
|
] |
96
|
|
|
]); |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|