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

PercolateResultDoc   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 9
dl 0
loc 28
rs 10
c 1
b 0
f 1
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A getQueries() 0 3 1
A hasQueries() 0 3 1
A getData() 0 3 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
}