1<?php
2
3namespace Elastica\Processor;
4
5/**
6 * Elastica Join Processor.
7 *
8 * @author Federico Panini <fpanini@gmail.com>
9 *
10 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/join-processor.html
11 */
12class Join extends AbstractProcessor
13{
14    /**
15     * Join constructor.
16     *
17     * @param string $field
18     * @param string $separator
19     */
20    public function __construct(string $field, string $separator)
21    {
22        $this->setField($field);
23        $this->setSeparator($separator);
24    }
25
26    /**
27     * Set the field.
28     *
29     * @param string $field
30     *
31     * @return $this
32     */
33    public function setField(string $field): self
34    {
35        return $this->setParam('field', $field);
36    }
37
38    /**
39     * Set the separator.
40     *
41     * @param string $separator
42     *
43     * @return $this
44     */
45    public function setSeparator(string $separator): self
46    {
47        return $this->setParam('separator', $separator);
48    }
49}
50