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

withinCenter() public method

Add $within criteria with a $center shape to the expression.
See also: Expr::geoWithinCenter()
See also: http://docs.mongodb.org/manual/reference/operator/center/
Deprecation: 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
public withinCenter ( float $x, float $y, float $radius )
$x float
$y float
$radius float
    public function withinCenter($x, $y, $radius)
    {
        $shape = ['$center' => [[$x, $y], $radius]];
        return $this->operator('$within', $shape);
    }

Usage Example

示例#1
0
 /**
  * Add $within criteria with a $center shape to the query.
  *
  * @deprecated 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
  * @see Builder::geoWithinCenter()
  * @see Expr::withinCenter()
  * @see http://docs.mongodb.org/manual/reference/operator/center/
  * @param float $x
  * @param float $y
  * @param float $radius
  * @return self
  */
 public function withinCenter($x, $y, $radius)
 {
     $this->expr->withinCenter($x, $y, $radius);
     return $this;
 }