Completed
Push — master ( f7db99...180f32 )
by Dmitry
03:22
created

KeywordsResearch::deduplicate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author Dmitry Gladyshev <[email protected]>
4
 * @date 03.05.17 7:46
5
 */
6
7
namespace Yandex\Direct\Service;
8
9
use Yandex\Direct\Exception\Exception;
10
use Yandex\Direct\Service;
11
12
final class KeywordsResearch extends Service
13
{
14
    /**
15
     * Для заданных ключевых фраз и регионов формирует предварительный прогноз наличия показов по этим фразам в
16
     * разбивке по типам устройств. Используется при подборе ключевых фраз.
17
     *
18
     * @param $SelectionCriteria
19
     * @param $FieldNames
20
     * @return array
21
     * @throws Exception
22
     *
23
     * @see https://tech.yandex.ru/direct/doc/ref-v5/keywordsresearch/hasSearchVolume-docpage/
24
     */
25
    public function hasSearchVolume($SelectionCriteria, $FieldNames)
26
    {
27
        return $this->request([
28
            'method' => 'hasSearchVolume',
29
            'params' => [
30
                'SelectionCriteria' => $SelectionCriteria,
31
                'FieldNames' => $FieldNames
32
            ]
33
        ]);
34
    }
35
36
    /**
37
     * Выполняет предварительную обработку массива ключевых фраз.
38
     *
39
     * @param $Keywords
40
     * @param null $Operation
41
     * @return array|\DOMDocument
42
     *
43
     * @throws Exception
44
     * @throws \Yandex\Direct\Exception\ErrorResponseException
45
     *
46
     * @see https://yandex.ru/dev/direct/doc/ref-v5/keywordsresearch/deduplicate-docpage/
47
     */
48
    public function deduplicate($Keywords, $Operation = null)
49
    {
50
        return $this->request([
51
            'method' => 'hasSearchVolume',
52
            'params' => [
53
                'Keywords' => $Keywords,
54
                'Operation' => $Operation
55
            ]
56
        ]);
57
    }
58
}
59