Passed
Push — sheepy/introspection ( 69e16c...c6c7ca )
by Marco
05:28
created

SearchResultSetTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
eloc 11
c 3
b 0
f 0
dl 0
loc 52
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setSpellcheck() 0 5 1
A setTotalItems() 0 5 1
A setHighlight() 0 5 1
1
<?php
2
3
4
namespace Firesphere\SolrSearch\Traits;
5
6
use Firesphere\SolrSearch\Results\SearchResult;
7
use SilverStripe\ORM\ArrayList;
8
use SilverStripe\View\ArrayData;
9
use Solarium\Component\Result\Highlighting\Highlighting;
10
11
trait SearchResultSetTrait
12
{
13
    /**
14
     * @var int
15
     */
16
    protected $totalItems;
17
    /**
18
     * @var ArrayData
19
     */
20
    protected $facets;
21
22
    /**
23
     * @var Highlighting
24
     */
25
    protected $highlight;
26
27
    /**
28
     * @var ArrayList
29
     */
30
    protected $spellcheck;
31
32
    /**
33
     * @param $highlight
34
     * @return SearchResult
35
     */
36
    public function setHighlight($highlight): self
37
    {
38
        $this->highlight = $highlight;
39
40
        return $this;
41
    }
42
43
    /**
44
     * @param $check
45
     * @return SearchResult
46
     */
47
    public function setSpellcheck($check): self
48
    {
49
        $this->spellcheck = $check;
50
51
        return $this;
52
    }
53
54
    /**
55
     * @param $count
56
     * @return self
57
     */
58
    public function setTotalItems($count): self
59
    {
60
        $this->totalItems = $count;
61
62
        return $this;
63
    }
64
}
65