1 | <?php |
||
36 | class SearchResult extends \Apache_Solr_Document |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | protected $throwExceptions = false; |
||
43 | |||
44 | /** |
||
45 | * @var SearchResult[] |
||
46 | */ |
||
47 | protected $variants = []; |
||
48 | |||
49 | /** |
||
50 | * Indicates if an instance of this document is a variant (a sub document of another). |
||
51 | * |
||
52 | * @var bool |
||
53 | */ |
||
54 | protected $isVariant = false; |
||
55 | |||
56 | /** |
||
57 | * References the parent document of the document is a variant. |
||
58 | * |
||
59 | * @var null |
||
60 | */ |
||
61 | protected $variantParent = null; |
||
62 | |||
63 | /** |
||
64 | * @param \Apache_Solr_Document $document |
||
65 | * @param bool $throwExceptions |
||
66 | */ |
||
67 | 35 | public function __construct(\Apache_Solr_Document $document, $throwExceptions = false) |
|
74 | |||
75 | /** |
||
76 | * @param string $name |
||
77 | * @param array $arguments |
||
78 | * @throws \Exception |
||
79 | * @throws \RuntimeException |
||
80 | * @return string |
||
81 | */ |
||
82 | public function __call($name, $arguments) |
||
83 | { |
||
84 | try { |
||
85 | return parent::__call($name, $arguments); |
||
86 | } catch (\RuntimeException $e) { |
||
87 | if ($this->throwExceptions) { |
||
88 | throw $e; |
||
89 | } |
||
90 | } |
||
91 | } |
||
92 | |||
93 | /** |
||
94 | * @return SearchResult[] |
||
95 | */ |
||
96 | 2 | public function getVariants() |
|
100 | |||
101 | /** |
||
102 | * @param SearchResult $expandedResult |
||
103 | */ |
||
104 | 2 | public function addVariant(SearchResult $expandedResult) |
|
108 | |||
109 | /** |
||
110 | * @return bool |
||
111 | */ |
||
112 | 1 | public function getIsVariant() |
|
116 | |||
117 | /** |
||
118 | * @param bool $isVariant |
||
119 | */ |
||
120 | 2 | public function setIsVariant($isVariant) |
|
124 | |||
125 | /** |
||
126 | * @return null |
||
127 | */ |
||
128 | public function getVariantParent() |
||
129 | { |
||
130 | return $this->variantParent; |
||
131 | } |
||
132 | |||
133 | /** |
||
134 | * @param null $variantParent |
||
135 | */ |
||
136 | 2 | public function setVariantParent($variantParent) |
|
140 | |||
141 | /** |
||
142 | * @return string |
||
143 | */ |
||
144 | 23 | public function getContent() |
|
148 | |||
149 | /** |
||
150 | * @return boolean |
||
151 | */ |
||
152 | 22 | public function getIsElevated() |
|
156 | |||
157 | /** |
||
158 | * @return string |
||
159 | */ |
||
160 | 22 | public function getType() |
|
164 | |||
165 | /** |
||
166 | * @return integer |
||
167 | */ |
||
168 | 22 | public function getId() |
|
172 | |||
173 | /** |
||
174 | * @return float |
||
175 | */ |
||
176 | 22 | public function getScore() |
|
180 | |||
181 | /** |
||
182 | * @return string |
||
183 | */ |
||
184 | 23 | public function getUrl() |
|
188 | |||
189 | /** |
||
190 | * @return string |
||
191 | */ |
||
192 | 25 | public function getTitle() |
|
196 | } |
||
197 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.