summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Filter/AbstractGeoShape.php
blob: 3585293b000bf1a24496d666f483c3ba5366a1fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

namespace Elastica\Filter;

/**
 * geo_shape filter
 *
 * Filter pre-indexed shape definitions
 *
 * @category Xodoa
 * @package Elastica
 * @author Bennie Krijger <benniekrijger@gmail.com>
 * @link http://www.elasticsearch.org/guide/reference/query-dsl/geo-shape-filter/
 */
abstract class AbstractGeoShape extends AbstractFilter
{
    const RELATION_INTERSECT    = 'intersects';
    const RELATION_DISJOINT     = 'disjoint';
    const RELATION_CONTAINS     = 'within';

    /**
     * @var string $_path
     *
     * elasticsearch path of the pre-indexed shape
     */
    protected $_path;

    /**
     * @var string $_relation
     *
     * the relation of the 2 shaped: intersects, disjoint, within
     */
    protected $_relation = self::RELATION_INTERSECT;

    /**
     * @param string $relation
     */
    public function setRelation($relation)
    {
        $this->_relation = $relation;
    }

    /**
     * @return string
     */
    public function getRelation()
    {
        return $this->_relation;
    }
}