We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 460ff7d commit b6fe339Copy full SHA for b6fe339
src/Aggregation/Nested.php
@@ -0,0 +1,33 @@
1
+<?php declare(strict_types = 1);
2
+
3
+namespace Spameri\ElasticQuery\Aggregation;
4
5
+class Nested implements \Spameri\ElasticQuery\Aggregation\LeafAggregationInterface
6
+{
7
8
+ private string $path;
9
10
11
+ public function __construct(
12
+ string $path
13
+ ) {
14
+ $this->path = $path;
15
+ }
16
17
18
+ public function key(): string
19
+ {
20
+ return 'nested_' . $this->path;
21
22
23
24
+ public function toArray(): array
25
26
+ return [
27
+ 'nested' => [
28
+ 'path' => $this->path,
29
+ ],
30
+ ];
31
32
33
+}
0 commit comments