Doctrine\MongoDB\Query\Expr::geoWithinCenterSphere PHP Method

geoWithinCenterSphere() public method

Note: the $centerSphere operator supports both 2d and 2dsphere indexes.
See also: Builder::geoWithinCenterSphere()
See also: http://docs.mongodb.org/manual/reference/operator/centerSphere/
public geoWithinCenterSphere ( float $x, float $y, float $radius )
$x float
$y float
$radius float
    public function geoWithinCenterSphere($x, $y, $radius)
    {
        $shape = ['$centerSphere' => [[$x, $y], $radius]];
        return $this->operator('$geoWithin', $shape);
    }

Usage Example

コード例 #1
0
ファイル: Builder.php プロジェクト: Wizkunde/mongodb
 /**
  * Add $geoWithin criteria with a $centerSphere shape to the query.
  *
  * Note: the $centerSphere operator supports both 2d and 2dsphere indexes.
  *
  * @see Expr::geoWithinCenterSphere()
  * @see http://docs.mongodb.org/manual/reference/operator/centerSphere/
  * @param float $x
  * @param float $y
  * @param float $radius
  * @return self
  */
 public function geoWithinCenterSphere($x, $y, $radius)
 {
     $this->expr->geoWithinCenterSphere($x, $y, $radius);
     return $this;
 }