Completed
Branch v2 (10e463)
by Alexey
02:41
created

Query::extractDocuments()   B

Complexity

Conditions 6
Paths 2

Size

Total Lines 20
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 8.8571
c 0
b 0
f 0
cc 6
eloc 13
nc 2
nop 1
1
<?php namespace Bardex\Elastic;
2
3
/**
4
 * Class Query
5
 * @package Bardex\Elastic
6
 * @author Alexey Sumin <[email protected]>
7
 */
8
abstract class Query
9
{
10
    /** @var Client */
11
    protected $client;
12
13
    /**
14
     * @param Client $client
15
     */
16
    public function __construct(Client $client)
17
    {
18
        $this->client = $client;
19
    }
20
21
    /**
22
     * @return Client
23
     */
24
    public function getClient()
25
    {
26
        return $this->client;
27
    }
28
29
    /**
30
     * Получить собранный elasticsearch-запрос
31
     * @return array
32
     */
33
    abstract public function getQuery();
34
35
    /**
36
     * @param bool $hydration
37
     * @return SearchResult|array
38
     */
39
    abstract public function fetchAll($hydration = true);
40
41
}
42