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

Public Member Functions | Protected Attributes | List of all members
eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance Class Reference

The MapLocationDistance Criterion class. More...

Inheritance diagram for eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance:

## Public Member Functions
| __construct ($target, $operator, $distance, $latitude, $longitude)
| getSpecifications ()
| Criterion description function. More...
| setCustomField ($type, $field, $customField)
| Set a custom field to query. More...
| getCustomField ($type, $field)
| Return custom field. More...
Public Member Functions inherited from eZ\Publish\API\Repository\Values\Content\Query\Criterion
| __construct ($target, $operator, $value, Value $valueData=null)
| Performs operator validation based on the Criterion specifications returned by {. More...

## Protected Attributes
| $customFields = []
| $boost

## Additional Inherited Members
Static Public Member Functions inherited from eZ\Publish\API\Repository\Values\Content\Query\Criterion
static | createFromQueryBuilder ($target, $operator, $value)
Public Attributes inherited from eZ\Publish\API\Repository\Values\Content\Query\Criterion
| $operator
| $value
| $target
| $valueData

## Detailed Description

The MapLocationDistance Criterion class.

Provides content filtering based on distance from geographical location.

Definition at line 19 of file API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance::__construct | ( |  | $target,
|  |  | $operator,
|  |  | $distance,
|  |  | $latitude,
|  |  | $longitude
| ) |  |

Parameters

  string | $target | FieldDefinition identifier
  string | $operator | One of the supported Operator constants
  float | float[] | $distance | The match value in kilometers, either as an array or as a single value, depending on the operator
  float | $latitude | Latitude of the location that distance is calculated from
  float | $longitude | Longitude of the location that distance is calculated from

Definition at line 43 of file API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php.

References eZ\Publish\API\Repository\Values\Content\Query\Criterion\$operator, and eZ\Publish\API\Repository\Values\Content\Query\Criterion\$target.

## Member Function Documentation

## ◆ getCustomField()

eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance::getCustomField | ( |  | $type,
|  |  | $field
| ) |  |

Return custom field.

If no custom field is set, return null

Parameters

  string | $type |
  string | $field |

Returns
  mixed

Implements eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface.

Definition at line 86 of file API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php.

## ◆ getSpecifications()

eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance::getSpecifications | ( |  | ) |

Criterion description function.

Returns the combination of the Criterion's supported operator/value, as an array of eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications objects

- Operator is one supported Operator, as an Operator::* constant
- ValueType is the type of input value this operator requires, either array or single
- SupportedTypes is an array of types the operator will accept
- ValueCountLimitation is an integer saying how many values are expected.

`// IN and EQ are supported return [ // The EQ operator expects a single value, either as an integer or a string new Specifications( Operator::EQ, Specifications::FORMAT_SINGLE, Specifications::TYPE_INTEGER | Specifications::TYPE_STRING ), // The IN operator expects an array of values, of either integers or strings new Specifications( Operator::IN, Specifications::FORMAT_ARRAY, Specifications::TYPE_INTEGER | Specifications::TYPE_STRING ) ]`

Returns
  \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications[]

Reimplemented from eZ\Publish\API\Repository\Values\Content\Query\Criterion.

Definition at line 49 of file API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php.

References eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\BETWEEN, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\EQ, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications\FORMAT_ARRAY, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications\FORMAT_SINGLE, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GT, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GTE, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\IN, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LT, and eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LTE.

## ◆ setCustomField()

eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance::setCustomField | ( |  | $type,
|  |  | $field,
|  |  | $customField
| ) |  |

Set a custom field to query.

Set a custom field to query for a defined field in a defined type.

Parameters

  string | $type |
  string | $field |
  string | $customField |

Implements eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface.

Definition at line 71 of file API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php.

## Member Data Documentation

## ◆ $boost

eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance::$boost
| protected

Definition at line 33 of file API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php.

## ◆ $customFields

eZ\Publish\API\Repository\Values\Content\Query\Criterion\MapLocationDistance::$customFields = []
| protected

Definition at line 26 of file API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php.

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

- API/Repository/Values/Content/Query/Criterion/MapLocationDistance.php

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