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

withinPolygon() public method

Point coordinates are in x, y order (easting, northing for projected coordinates, longitude, latitude for geographic coordinates). The last point coordinate is implicitly connected with the first.
See also: Expr::geoWithinPolygon()
See also: http://docs.mongodb.org/manual/reference/operator/polygon/
Deprecation: 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
public withinPolygon ( )
    public function withinPolygon()
    {
        if (func_num_args() < 3) {
            throw new InvalidArgumentException('Polygon must be defined by three or more points.');
        }
        $shape = ['$polygon' => func_get_args()];
        return $this->operator('$within', $shape);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Add $within criteria with a $polygon shape to the query.
  *
  * Point coordinates are in x, y order (easting, northing for projected
  * coordinates, longitude, latitude for geographic coordinates).
  *
  * The last point coordinate is implicitly connected with the first.
  *
  * @deprecated 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
  * @see Builder::geoWithinPolygon()
  * @see Expr::withinPolygon()
  * @see http://docs.mongodb.org/manual/reference/operator/polygon/
  * @param array $point,... Three or more point coordinate tuples
  * @return $this
  */
 public function withinPolygon()
 {
     $this->expr->withinPolygon(...func_get_args());
     return $this;
 }
All Usage Examples Of Doctrine\MongoDB\Query\Expr::withinPolygon