Completed
Push — master ( f5e740...967473 )
by Florian
02:51
created

ResultSetAdapter::setResults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Stinger Entity Search package.
5
 *
6
 * (c) Oliver Kotte <[email protected]>
7
 * (c) Florian Meyer <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
namespace StingerSoft\EntitySearchBundle\Model;
13
14
use StingerSoft\EntitySearchBundle\Model\Result\FacetSet;
15
16
class ResultSetAdapter implements ResultSet {
17
18
	/**
19
	 *
20
	 * @var FacetSet
21
	 */
22
	protected $facets = null;
23
24
	/**
25
	 *
26
	 * @var Document[]
27
	 */
28
	protected $results = array();
29
30
	public function setFacets(FacetSet $facets) {
31
		$this->facets = $facets;
32
	}
33
34
	/**
35
	 *
36
	 * {@inheritdoc}
37
	 *
38
	 * @see \StingerSoft\EntitySearchBundle\Model\ResultSet::getFacets()
39
	 */
40
	public function getFacets() {
41
		return $this->facets;
42
	}
43
44
	/**
45
	 *
46
	 * {@inheritdoc}
47
	 *
48
	 * @see \StingerSoft\EntitySearchBundle\Model\ResultSet::getResults()
49
	 */
50
	public function getResults($offset = 0, $limit = null) {
51
		return array_slice($this->results, $offset, $limit);
52
	}
53
54
	/**
55
	 *
56
	 * @param Document[] $results        	
57
	 */
58
	public function setResults(array $results) {
59
		$this->results = $results;
60
	}
61
62
	/**
63
	 *
64
	 * {@inheritdoc}
65
	 *
66
	 * @see \StingerSoft\EntitySearchBundle\Model\ResultSet::getExcerpt()
67
	 */
68
	public function getExcerpt(Document $document) {
69
		return null;
70
	}
71
72
	/**
73
	 *
74
	 * {@inheritdoc}
75
	 *
76
	 * @see \StingerSoft\EntitySearchBundle\Model\ResultSet::getCorrections()
77
	 */
78
	public function getCorrections() {
79
		return null;
80
	}
81
}