| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Nord\Lumen\Elasticsearch\Search\Query\Joining; |
||
| 24 | public function toArray() |
||
| 25 | { |
||
| 26 | $query = $this->getQuery(); |
||
| 27 | |||
| 28 | if ($query === null) { |
||
| 29 | throw new InvalidArgument('Query must be set'); |
||
| 30 | } |
||
| 31 | |||
| 32 | $nested = [ |
||
| 33 | 'path' => $this->getPath(), |
||
| 34 | 'query' => $query->toArray(), |
||
| 35 | ]; |
||
| 36 | |||
| 37 | $scoreMode = $this->getScoreMode(); |
||
| 38 | if (null !== $scoreMode) { |
||
| 39 | $nested['score_mode'] = $scoreMode; |
||
| 40 | } |
||
| 41 | |||
| 42 | return ['nested' => $nested]; |
||
| 43 | } |
||
| 64 |