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

API/Repository/Values/Content/Query/SortClause/MapLocationDistance.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\API\Repository\Values\Content\Query\SortClause;
8
9 use eZ\Publish\API\Repository\Values\Content\Query;
10 use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
11 use eZ\Publish\API\Repository\Values\Content\Query\SortClause\Target\MapLocationTarget;
12 use eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface;
13
17 class MapLocationDistance extends SortClause implements CustomFieldInterface
18 {
24 protected $customFields = [];
25
35 public function __construct(
36 $typeIdentifier,
37 $fieldIdentifier,
38 $latitude,
39 $longitude,
40 $sortDirection = Query::SORT_ASC
41 ) {
42 parent::__construct(
43 'maplocation_distance',
44 $sortDirection,
45 new MapLocationTarget(
46 $latitude,
47 $longitude,
48 $typeIdentifier,
49 $fieldIdentifier
50 )
51 );
52 }
53
63 public function setCustomField($type, $field, $customField)
64 {
65 $this->customFields[$type][$field] = $customField;
66 }
67
78 public function getCustomField($type, $field)
79 {
80 if (!isset($this->customFields[$type]) ||
81 !isset($this->customFields[$type][$field])) {
82 return null;
83 }
84
85 return $this->customFields[$type][$field];
86 }
87 }
eZ\Publish\API\Repository\Values\Content\Query\SortClause\MapLocationDistance
Sets sort direction on the MapLocation distance for a content query.
Definition: API/Repository/Values/Content/Query/SortClause/MapLocationDistance.php:18
eZ\Publish\API\Repository\Values\Content\Query\SortClause\MapLocationDistance\$customFields
$customFields
Definition: API/Repository/Values/Content/Query/SortClause/MapLocationDistance.php:24
eZ\Publish\API\Repository\Values\Content\Query\SortClause\MapLocationDistance\setCustomField
setCustomField($type, $field, $customField)
Set a custom field to sort by.
Definition: API/Repository/Values/Content/Query/SortClause/MapLocationDistance.php:63
eZ\Publish\API\Repository\Values\Content\Query\SortClause\MapLocationDistance\__construct
__construct( $typeIdentifier, $fieldIdentifier, $latitude, $longitude, $sortDirection=Query::SORT_ASC)
Constructs a new MapLocationDistance SortClause on Type $typeIdentifier and Field $fieldIdentifier.
Definition: API/Repository/Values/Content/Query/SortClause/MapLocationDistance.php:35
eZ\Publish\API\Repository\Values\Content\Query\SortClause\MapLocationDistance\getCustomField
getCustomField($type, $field)
Return custom field.
Definition: API/Repository/Values/Content/Query/SortClause/MapLocationDistance.php:78
eZ\Publish\API\Repository\Values\Content\Query\SortClause\Target\MapLocationTarget
Struct that stores extra value information for a MapLocationDistance SortClause object.
Definition: MapLocationTarget.php:15
eZ\Publish\API\Repository\Values\Content\Query\SortClause
This class is the base for SortClause classes, used to set sorting of content queries.
Definition: Content/Query/SortClause.php:16
eZ\Publish\API\Repository\Values\Content\Query
This class is used to perform a Content query.
Definition: API/Repository/Values/Content/Query.php:15
eZ\Publish\API\Repository\Values\Content\Query\SORT_ASC
const SORT_ASC
Definition: API/Repository/Values/Content/Query.php:16
eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
Interface for criteria and sort clauses, which defines a custom field mapping.
Definition: CustomFieldInterface.php:18
eZ\Publish\API\Repository\Values\Content\Query\SortClause
Definition: API/Repository/Values/Content/Query/SortClause/ContentId.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.