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