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

geoIntersects() public method

The geometry parameter GeoJSON object or an array corresponding to the geometry's JSON representation.
See also: Builder::geoIntersects()
See also: http://docs.mongodb.org/manual/reference/operator/geoIntersects/
public geoIntersects ( array | GeoJson\Geometry\Geometry $geometry )
$geometry array | GeoJson\Geometry\Geometry
    public function geoIntersects($geometry)
    {
        if ($geometry instanceof Geometry) {
            $geometry = $geometry->jsonSerialize();
        }
        return $this->operator('$geoIntersects', ['$geometry' => $geometry]);
    }

Usage Example

示例#1
0
 /**
  * Add $geoIntersects criteria with a GeoJSON geometry to the query.
  *
  * The geometry parameter GeoJSON object or an array corresponding to the
  * geometry's JSON representation.
  *
  * @see Expr::geoIntersects()
  * @see http://docs.mongodb.org/manual/reference/operator/geoIntersects/
  * @param array|Geometry $geometry
  * @return self
  */
 public function geoIntersects($geometry)
 {
     $this->expr->geoIntersects($geometry);
     return $this;
 }