Elastica\Query\AbstractGeoDistance::__construct PHP Method

__construct() public method

Create GeoDistance object.
public __construct ( string $key, array | string $location )
$key string Key
$location array | string Location as array or geohash: array('lat' => 48.86, 'lon' => 2.35) OR 'drm3btev3e86'
    public function __construct($key, $location)
    {
        $this->setKey($key);
        $this->setLocation($location);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param string       $key
  * @param array|string $location
  * @param array        $ranges
  *
  * @internal param string $distance
  */
 public function __construct($key, $location, array $ranges = array())
 {
     parent::__construct($key, $location);
     if (!empty($ranges)) {
         $this->setRanges($ranges);
     }
 }