| @@ 29-42 (lines=14) @@ | ||
| 26 | /** |
|
| 27 | * @inheritdoc |
|
| 28 | */ |
|
| 29 | public function toArray() |
|
| 30 | { |
|
| 31 | $hasParent = [ |
|
| 32 | 'parent_type' => $this->getType(), |
|
| 33 | 'query' => $this->getQuery()->toArray(), |
|
| 34 | ]; |
|
| 35 | ||
| 36 | $scoreMode = $this->getScoreMode(); |
|
| 37 | if (!is_null($scoreMode)) { |
|
| 38 | $hasParent['score_mode'] = $scoreMode; |
|
| 39 | } |
|
| 40 | ||
| 41 | return ['has_parent' => $hasParent]; |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * @inheritdoc |
|
| @@ 29-42 (lines=14) @@ | ||
| 26 | /** |
|
| 27 | * @inheritdoc |
|
| 28 | */ |
|
| 29 | public function toArray() |
|
| 30 | { |
|
| 31 | $nested = [ |
|
| 32 | 'path' => $this->getPath(), |
|
| 33 | 'query' => $this->getQuery()->toArray(), |
|
| 34 | ]; |
|
| 35 | ||
| 36 | $scoreMode = $this->getScoreMode(); |
|
| 37 | if (!is_null($scoreMode)) { |
|
| 38 | $nested['score_mode'] = $scoreMode; |
|
| 39 | } |
|
| 40 | ||
| 41 | return ['nested' => $nested]; |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * @inheritdoc |
|