Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Public Attributes | Protected Member Functions | List of all members
eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance Class Reference

MapLocationDistance criterion handler. More...

Inheritance diagram for eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance:

## Public Member Functions
| accept (Criterion $criterion)
| Check if this criterion handler accepts to handle the given criterion. More...
Public Member Functions inherited from eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldBase
| __construct (DatabaseHandler $dbHandler, ContentTypeHandler $contentTypeHandler, LanguageHandler $languageHandler)
| Construct from handler handler. More...
Public Member Functions inherited from eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
| __construct (DatabaseHandler $dbHandler)
| Creates a new criterion handler. More...
| handle (CriteriaConverter $converter, SelectQuery $query, Criterion $criterion, array $languageSettings)
| Generate query expression for a Criterion this handler accepts. More...

## Public Attributes
const | DEGREE_KM = 111.195
| Distance in kilometers of one degree longitude at the Equator. More...
const | EARTH_RADIUS = 6371.01
| Radius of the planet in kilometers. More...

## Protected Member Functions
| getFieldDefinitionIds ($fieldIdentifier)
| Returns a list of IDs of searchable FieldDefinitions for the given criterion target. More...
| kilometersToDegrees ($kilometers)
| getBoundingConstraints (SelectQuery $query, MapLocationValue $location, $distance)
| Credit for the formula goes to http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates. More...
| getBoundingCoordinates (MapLocationValue $location, $distance)
| Calculates and returns bounding box coordinates. More...
Protected Member Functions inherited from eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldBase
| getFieldCondition (SelectQuery $query, array $languageSettings)
| Returns a field language join condition for the given $languageSettings. More...
| getInExpressionWithFieldConditions (SelectQuery $query, SelectQuery $subSelect, array $languageSettings, array $fieldWhereExpressions, array $fieldsInformation)
Protected Member Functions inherited from eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
| getUniqueTableName ()
| Returns a unique table name. More...

## Additional Inherited Members
Protected Attributes inherited from eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldBase
| $contentTypeHandler
| $languageHandler
Protected Attributes inherited from eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
| $comparatorMap
| $dbHandler

## Detailed Description

MapLocationDistance criterion handler.

Definition at line 19 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

## Member Function Documentation

## ◆ accept()

eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::accept | ( | Criterion | $criterion | ) |

Check if this criterion handler accepts to handle the given criterion.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |

Returns
  bool

Reimplemented from eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler.

Definition at line 38 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

## ◆ getBoundingConstraints()

eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::getBoundingConstraints | ( | SelectQuery | $query,
|  | MapLocationValue | $location,
|  |  | $distance
| ) |  |
| protected

Credit for the formula goes to http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates.

Parameters

  \eZ\Publish\Core\Persistence\Database\SelectQuery | $query |
  \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue | $location |
  float | $distance |

Returns
  array

Definition at line 248 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

References eZ\Publish\Core\Persistence\Database\Query\bindValue(), and eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance\getBoundingCoordinates().

## ◆ getBoundingCoordinates()

eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::getBoundingCoordinates | ( | MapLocationValue | $location,
|  |  | $distance
| ) |  |
| protected

Calculates and returns bounding box coordinates.

Credits: http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates

Todo:
  it should also be possible to calculate inner bounding box, which could be applied for the operators GT, GTE and lower distance of the BETWEEN operator.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue | $location |
  float | $distance |

Returns
  array

Definition at line 285 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

References eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance\EARTH_RADIUS.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance\getBoundingConstraints().

## ◆ getFieldDefinitionIds()

eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::getFieldDefinitionIds | ( |  | $fieldIdentifier | ) |
| protected

Returns a list of IDs of searchable FieldDefinitions for the given criterion target.

Exceptions

Definition at line 52 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

## ◆ kilometersToDegrees()

eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::kilometersToDegrees | ( |  | $kilometers | ) |
| protected

Definition at line 81 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

References eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance\DEGREE_KM.

## Member Data Documentation

## ◆ DEGREE_KM

const eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::DEGREE_KM = 111.195

Distance in kilometers of one degree longitude at the Equator.

Definition at line 24 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance\kilometersToDegrees().

## ◆ EARTH_RADIUS

const eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::EARTH_RADIUS = 6371.01

Radius of the planet in kilometers.

Definition at line 29 of file Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance\getBoundingCoordinates().

The documentation for this class was generated from the following file:

- Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.