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