You are here

protected function SearchApiViewsHandlerArgumentLocationBbox::parseCorners in Search API Location 7.2

Parses the comma-separated representation of a rectangle into its parts.

Parameters

string $bbox: The bounding box argument to parse, in the format: left,bottom,right,top.

Return value

array|null NULL if $bbox didn't have the correct format. Otherwise, an associative array with the rectangle coordinates in the keys:

  • left
  • bottom
  • right
  • top
1 call to SearchApiViewsHandlerArgumentLocationBbox::parseCorners()
SearchApiViewsHandlerArgumentLocationBbox::query in search_api_location_views/handler_argument_bbox.inc
Set up the query for this argument.

File

search_api_location_views/handler_argument_bbox.inc, line 26
Contains SearchApiViewsHandlerArgumentLocationBbox.

Class

SearchApiViewsHandlerArgumentLocationBbox
Provides an argument handler for filtering location fields to a bounding box.

Code

protected function parseCorners($bbox) {
  $parts = explode(',', $bbox);
  if (count($parts) == 4) {
    return array_combine(array(
      'left',
      'bottom',
      'right',
      'top',
    ), $parts);
  }
  return NULL;
}