1 | <?php |
||
21 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-containing-query.html |
||
22 | */ |
||
23 | class SpanContainingQuery implements SpanQueryInterface |
||
24 | { |
||
25 | use ParametersTrait; |
||
26 | |||
27 | public function __construct(private SpanQueryInterface $little, private SpanQueryInterface $big) |
||
|
|||
28 | { |
||
29 | $this->setLittle($little); |
||
30 | $this->setBig($big); |
||
31 | } |
||
32 | |||
33 | public function getLittle(): SpanQueryInterface |
||
34 | { |
||
35 | return $this->little; |
||
36 | } |
||
37 | |||
38 | public function setLittle(SpanQueryInterface $little): static |
||
39 | { |
||
40 | $this->little = $little; |
||
41 | |||
42 | return $this; |
||
43 | } |
||
44 | |||
45 | public function getBig(): SpanQueryInterface |
||
46 | { |
||
47 | return $this->big; |
||
48 | } |
||
49 | |||
50 | public function setBig(SpanQueryInterface $big): static |
||
51 | { |
||
52 | $this->big = $big; |
||
53 | |||
54 | return $this; |
||
55 | } |
||
56 | |||
57 | public function getType(): string |
||
58 | { |
||
59 | return 'span_containing'; |
||
60 | } |
||
61 | |||
62 | public function toArray(): array |
||
63 | { |
||
64 | $output = [ |
||
65 | 'little' => $this->getLittle()->toArray(), |
||
66 | 'big' => $this->getBig()->toArray(), |
||
67 | ]; |
||
68 | |||
69 | $output = $this->processArray($output); |
||
70 | |||
71 | return [$this->getType() => $output]; |
||
72 | } |
||
73 | } |
||
74 |