1<?php
2
3namespace Elastica\Processor;
4
5/**
6 * Elastica Append Processor.
7 *
8 * @author Federico Panini <fpanini@gmail.com>
9 *
10 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html
11 */
12class Append extends AbstractProcessor
13{
14    /**
15     * Append constructor.
16     *
17     * @param string       $field field name
18     * @param string|array $value field values to append
19     */
20    public function __construct(string $field, $value)
21    {
22        $this->setField($field);
23        $this->setValue($value);
24    }
25
26    /**
27     * Set 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 field value.
40     *
41     * @param string|array $value
42     *
43     * @return $this
44     */
45    public function setValue($value): self
46    {
47        return $this->setParam('value', $value);
48    }
49}
50