lib/CosmoW/Riak/Collection.php
public function near($near, array $query = array(), array $options = array())
    {
        if ($this->eventManager->hasListeners(Events::preNear)) {
            $this->eventManager->dispatchEvent(Events::preNear, new NearEventArgs($this, $query, $near, $options));
        }

        $result = $this->doNear($near, $query, $options);

        if ($this->eventManager->hasListeners(Events::postNear)) {
            $eventArgs = new MutableEventArgs($this, $result);
            $this->eventManager->dispatchEvent(Events::postNear, $eventArgs);
            $result = $eventArgs->getData();
        }

        return $result;
    }
public function near($near, array $query = array(), array $options = array())
    {
        if ($this->eventManager->hasListeners(Events::preNear)) {
            $this->eventManager->dispatchEvent(Events::preNear, new NearEventArgs($this, $query, $near, $options));
        }

        $result = $this->doNear($near, $query, $options);

        if ($this->eventManager->hasListeners(Events::postNear)) {
            $eventArgs = new MutableEventArgs($this, $result);
            $this->eventManager->dispatchEvent(Events::postNear, $eventArgs);
            $result = $eventArgs->getData();
        }

        return $result;
    }
public function near ( $ near , array $ query = array ( ) , array $ options = array ( ) ) { if ( $ this -> eventManager -> hasListeners ( Events :: preNear ) ) { $ this -> eventManager -> dispatchEvent ( Events :: preNear , new NearEventArgs ( $ this , $ query , $ near , $ options ) ) ; } $ result = $ this -> doNear ( $ near , $ query , $ options ) ; if ( $ this -> eventManager -> hasListeners ( Events :: postNear ) ) { $ eventArgs = new MutableEventArgs ( $ this , $ result ) ; $ this -> eventManager -> dispatchEvent ( Events :: postNear , $ eventArgs ) ; $ result = $ eventArgs -> getData ( ) ; } return $ result ; }
Invokes the geoNear command.

This method will dispatch preNear and postNear events.

The $near parameter may be a GeoJSON point or a legacy coordinate pair,
which is an array of float values in x, y order (easting, northing for
projected coordinates, longitude, latitude for geographic coordinates).
A GeoJSON point may be a Point object or an array corresponding to the
point's JSON representation.

@see http://docs.mongodb.org/manual/reference/command/geoNear/
@param array|Point $near
@param array       $query
@param array       $options
@return ArrayIterator
@throws ResultException if the command fails
Invokes the geoNear command .