|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author Dmitry Gladyshev <[email protected]> |
|
4
|
|
|
* @created 03.12.16 15:26 |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
namespace Yandex\Direct\Service; |
|
8
|
|
|
|
|
9
|
|
|
use Yandex\Direct\Exception\Exception; |
|
10
|
|
|
use Yandex\Direct\Service; |
|
11
|
|
|
use function Yandex\Direct\get_param_names; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Class RetargetingLists |
|
15
|
|
|
* @package Yandex\Direct\Service |
|
16
|
|
|
*/ |
|
17
|
|
|
final class RetargetingLists extends Service |
|
18
|
|
|
{ |
|
19
|
|
|
/** |
|
20
|
|
|
* Создает условия подбора аудитории. |
|
21
|
|
|
* |
|
22
|
|
|
* @param $RetargetingLists |
|
23
|
|
|
* @return array |
|
24
|
|
|
* @throws Exception |
|
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->request([ |
|
32
|
|
|
'method' => 'get', |
|
33
|
|
|
'params' => [ |
|
34
|
|
|
'RetargetingLists' => $RetargetingLists |
|
35
|
|
|
] |
|
36
|
|
|
]); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Удаляет условия подбора аудитории. |
|
41
|
|
|
* |
|
42
|
|
|
* @param $SelectionCriteria |
|
43
|
|
|
* @return array |
|
44
|
|
|
* @throws Exception |
|
45
|
|
|
* |
|
46
|
|
|
* @see https://tech.yandex.ru/direct/doc/ref-v5/retargetinglists/delete-docpage/ |
|
47
|
|
|
*/ |
|
48
|
|
|
public function delete($SelectionCriteria) |
|
49
|
|
|
{ |
|
50
|
|
|
return $this->request([ |
|
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 Exception |
|
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->request([ |
|
75
|
|
|
'method' => 'get', |
|
76
|
|
|
'params' => $params |
|
77
|
|
|
]); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Изменяет параметры условий подбора аудитории. |
|
82
|
|
|
* |
|
83
|
|
|
* @param $RetargetingLists |
|
84
|
|
|
* @return array |
|
85
|
|
|
* @throws Exception |
|
86
|
|
|
* |
|
87
|
|
|
* @see https://tech.yandex.ru/direct/doc/ref-v5/retargetinglists/update-docpage/ |
|
88
|
|
|
*/ |
|
89
|
|
|
public function update($RetargetingLists) |
|
90
|
|
|
{ |
|
91
|
|
|
return $this->request([ |
|
92
|
|
|
'method' => 'update', |
|
93
|
|
|
'params' => [ |
|
94
|
|
|
'RetargetingLists' => $RetargetingLists |
|
95
|
|
|
] |
|
96
|
|
|
]); |
|
97
|
|
|
} |
|
98
|
|
|
} |
|
99
|
|
|
|