Doctrine\MongoDB\Query\Builder::spherical PHP Method

spherical() public method

Set the "spherical" option for a geoNear command query.
public spherical ( boolean $spherical = true )
$spherical boolean
    public function spherical($spherical = true)
    {
        if ($this->query['type'] !== Query::TYPE_GEO_NEAR) {
            throw new BadMethodCallException('This method requires a geoNear command (call geoNear() first)');
        }
        $this->query['geoNear']['options']['spherical'] = $spherical;
        return $this;
    }