| 1 | <?php |
||
| 8 | * For the full copyright and license information, please view the LICENSE |
||
| 9 | * file that was distributed with this source code. |
||
| 10 | */ |
||
| 11 | |||
| 12 | declare(strict_types=1); |
||
| 13 | |||
| 14 | namespace ONGR\ElasticsearchDSL\Aggregation\Pipeline; |
||
| 15 | |||
| 16 | use ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation; |
||
| 17 | use ONGR\ElasticsearchDSL\Aggregation\Type\MetricTrait; |
||
| 18 | |||
| 19 | abstract class AbstractPipelineAggregation extends AbstractAggregation |
||
| 20 | { |
||
| 21 | use MetricTrait; |
||
| 22 | |||
| 23 | public function __construct(private string $name, private mixed $bucketsPath) |
||
|
|
|||
| 24 | { |
||
| 25 | parent::__construct($name); |
||
| 26 | $this->setBucketsPath($bucketsPath); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getBucketsPath(): mixed |
||
| 30 | { |
||
| 31 | return $this->bucketsPath; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function setBucketsPath(mixed $bucketsPath): static |
||
| 35 | { |
||
| 36 | $this->bucketsPath = $bucketsPath; |
||
| 37 | |||
| 38 | return $this; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getArray(): array |
||
| 42 | { |
||
| 43 | return ['buckets_path' => $this->getBucketsPath()]; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |