Completed
Push — master ( 0e81d4...c51b03 )
by Nicolas
05:56 queued 02:39
created

GeoBounds::setField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Elastica\Aggregation;
3
4
/**
5
 * Class GeoBounds.
6
 *
7
 * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geobounds-aggregation.html
8
 */
9
class GeoBounds extends AbstractAggregation
10
{
11
    /**
12
     * @param string $name  the name of this aggregation
13
     * @param string $field the field on which to perform this aggregation
14
     */
15
    public function __construct($name, $field)
16
    {
17
        parent::__construct($name);
18
        $this->setField($field);
19
    }
20
21
    /**
22
     * Set the field for this aggregation.
23
     *
24
     * @param string $field the name of the document field on which to perform this aggregation
25
     *
26
     * @return $this
27
     */
28
    public function setField($field)
29
    {
30
        return $this->setParam('field', $field);
31
    }
32
}
33