diff options
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Filter/AbstractGeoDistance.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Filter/AbstractGeoDistance.php | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Filter/AbstractGeoDistance.php b/vendor/ruflin/elastica/lib/Elastica/Filter/AbstractGeoDistance.php index 997ceab7..b208afb4 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Filter/AbstractGeoDistance.php +++ b/vendor/ruflin/elastica/lib/Elastica/Filter/AbstractGeoDistance.php @@ -1,25 +1,22 @@ <?php - namespace Elastica\Filter; use Elastica\Exception\InvalidException; /** - * Geo distance filter + * Geo distance filter. * - * @category Xodoa - * @package Elastica * @author Nicolas Ruflin <spam@ruflin.com> - * @link http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html + * + * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-filter.html */ abstract class AbstractGeoDistance extends AbstractFilter { - const LOCATION_TYPE_GEOHASH = 'geohash'; const LOCATION_TYPE_LATLON = 'latlon'; /** - * Location type + * Location type. * * Decides if this filter uses latitude/longitude or geohash for the location. * Values are "latlon" or "geohash". @@ -29,38 +26,39 @@ abstract class AbstractGeoDistance extends AbstractFilter protected $_locationType = null; /** - * Key + * Key. * * @var string */ protected $_key = null; /** - * Latitude + * Latitude. * * @var float */ protected $_latitude = null; /** - * Longitude + * Longitude. * * @var float */ protected $_longitude = null; /** - * Geohash + * Geohash. * * @var string */ protected $_geohash = null; /** - * Create GeoDistance object + * Create GeoDistance object. + * + * @param string $key Key + * @param array|string $location Location as array or geohash: array('lat' => 48.86, 'lon' => 2.35) OR 'drm3btev3e86' * - * @param string $key Key - * @param array|string $location Location as array or geohash: array('lat' => 48.86, 'lon' => 2.35) OR 'drm3btev3e86' * @internal param string $distance Distance */ public function __construct($key, $location) @@ -71,8 +69,9 @@ abstract class AbstractGeoDistance extends AbstractFilter } /** - * @param string $key - * @return \Elastica\Filter\AbstractGeoDistance current filter + * @param string $key + * + * @return $this */ public function setKey($key) { @@ -82,9 +81,11 @@ abstract class AbstractGeoDistance extends AbstractFilter } /** - * @param array|string $location - * @return \Elastica\Filter\AbstractGeoDistance + * @param array|string $location + * * @throws \Elastica\Exception\InvalidException + * + * @return $this */ public function setLocation($location) { @@ -113,8 +114,9 @@ abstract class AbstractGeoDistance extends AbstractFilter } /** - * @param float $latitude - * @return \Elastica\Filter\AbstractGeoDistance current filter + * @param float $latitude + * + * @return $this */ public function setLatitude($latitude) { @@ -125,8 +127,9 @@ abstract class AbstractGeoDistance extends AbstractFilter } /** - * @param float $longitude - * @return \Elastica\Filter\AbstractGeoDistance current filter + * @param float $longitude + * + * @return $this */ public function setLongitude($longitude) { @@ -137,8 +140,9 @@ abstract class AbstractGeoDistance extends AbstractFilter } /** - * @param string $geohash - * @return \Elastica\Filter\AbstractGeoDistance current filter + * @param string $geohash + * + * @return $this */ public function setGeohash($geohash) { @@ -149,8 +153,9 @@ abstract class AbstractGeoDistance extends AbstractFilter } /** - * @return array|string * @throws \Elastica\Exception\InvalidException + * + * @return array|string */ protected function _getLocationData() { @@ -179,7 +184,10 @@ abstract class AbstractGeoDistance extends AbstractFilter /** * @see \Elastica\Param::toArray() + * * @throws \Elastica\Exception\InvalidException + * + * @return array */ public function toArray() { |