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    public function __construct(?AbstractSpanQuery $include = null, ?AbstractSpanQuery $exclude = null)
15    {
16        if (null !== $include) {
17            $this->setInclude($include);
18        }
19
20        if (null !== $exclude) {
21            $this->setExclude($exclude);
22        }
23    }
24
25    /**
26     * @return $this
27     */
28    public function setInclude(AbstractSpanQuery $include): self
29    {
30        return $this->setParam('include', $include);
31    }
32
33    /**
34     * @return $this
35     */
36    public function setExclude(AbstractSpanQuery $exclude): self
37    {
38        return $this->setParam('exclude', $exclude);
39    }
40}
41