Conditions | 4 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function toArray() |
||
27 | { |
||
28 | if (!isset($this->field) || !isset($this->value)) { |
||
29 | throw new InvalidArgument('"field" and "value" must be set for this type of query'); |
||
30 | } |
||
31 | |||
32 | $definition = [ |
||
33 | 'value' => $this->getValue(), |
||
34 | ]; |
||
35 | |||
36 | if ($this->hasBoost()) { |
||
37 | $definition['boost'] = $this->getBoost(); |
||
38 | } |
||
39 | |||
40 | return [ |
||
41 | 'wildcard' => [ |
||
42 | $this->getField() => $definition, |
||
43 | ], |
||
67 |