1<?php
2
3namespace Elastica\Query;
4
5/**
6 * SpanWithin query.
7 *
8 * @author Alessandro Chitolina <alekitto@gmail.com>
9 *
10 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-within-query.html
11 */
12class SpanWithin extends AbstractSpanQuery
13{
14    /**
15     * Constructs a SpanWithin query object.
16     *
17     * @param AbstractSpanQuery $little
18     * @param AbstractSpanQuery $big
19     */
20    public function __construct(AbstractSpanQuery $little = null, AbstractSpanQuery $big = null)
21    {
22        if (null !== $little) {
23            $this->setLittle($little);
24        }
25
26        if (null !== $big) {
27            $this->setBig($big);
28        }
29    }
30
31    /**
32     * @param AbstractSpanQuery $little
33     *
34     * @return $this
35     */
36    public function setLittle(AbstractSpanQuery $little): self
37    {
38        return $this->setParam('little', $little);
39    }
40
41    /**
42     * @param AbstractSpanQuery $big
43     *
44     * @return $this
45     */
46    public function setBig(AbstractSpanQuery $big): self
47    {
48        return $this->setParam('big', $big);
49    }
50}
51