Passed
Push — master ( f1e39a...75b946 )
by Adrian
04:36
created

PercolateResultDoc::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
rs 10
c 1
b 0
f 1
1
<?php
2
3
4
namespace Manticoresearch\Results;
5
6
7
use Manticoresearch\ResultHit;
8
9
class PercolateResultDoc
10
{
11
    protected $doc;
12
13
14
    public function __construct($doc)
15
    {
16
        $this->doc = ['doc'=>$doc['doc']];
17
        $this->doc['queries'] = [];
18
        foreach($doc['queries'] as $query)
19
        {
20
            $this->doc['queries'][] = new PercolateResultHit($query);
21
        }
22
    }
23
24
    public function getQueries()
25
    {
26
        return $this->doc['queries'];
27
    }
28
29
    public function getData()
30
    {
31
        return $this->doc['doc'];
32
    }
33
34
    public function hasQueries()
35
    {
36
        return count($this->doc['queries'])>0;
37
    }
38
39
}