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

Elasticsearch/Content/FieldValueMapper/GeoLocationMapper.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Elasticsearch\Content\FieldValueMapper;
8
9 use eZ\Publish\Core\Search\Common\FieldValueMapper;
10 use eZ\Publish\SPI\Search\FieldType\GeoLocationField;
11 use eZ\Publish\SPI\Search\Field;
12
16 class GeoLocationMapper extends FieldValueMapper
17 {
25 public function canMap(Field $field)
26 {
27 return $field->type instanceof GeoLocationField;
28 }
29
37 public function map(Field $field)
38 {
39 if (!isset($field->value['latitude'], $field->value['longitude'])) {
40 return null;
41 }
42
43 return [
44 'lat' => $field->value['latitude'],
45 'lon' => $field->value['longitude'],
46 ];
47 }
48 }
eZ\Publish\Core\Search\Common\FieldValueMapper\GeoLocationMapper
Common geo location field value mapper implementation.
Definition: Common/FieldValueMapper/GeoLocationMapper.php:17
eZ\Publish\Core\Search\Common\FieldValueMapper
Maps raw field values to something search engine can understand.
Definition: FieldValueMapper.php:21
eZ\Publish\Core\Search\Elasticsearch\Content\FieldValueMapper\GeoLocationMapper\map
map(Field $field)
Map field value to a proper Solr representation.
Definition: Elasticsearch/Content/FieldValueMapper/GeoLocationMapper.php:37
eZ\Publish\Core\Search\Elasticsearch\Content\FieldValueMapper\GeoLocationMapper\canMap
canMap(Field $field)
Check if field can be mapped.
Definition: Elasticsearch/Content/FieldValueMapper/GeoLocationMapper.php:25
eZ\Publish\SPI\Search\FieldType\GeoLocationField
GeoLocation document field.
Definition: GeoLocationField.php:15
eZ\Publish\SPI\Search\Field
Definition: SPI/Search/Field.php:19
eZ\Publish\Core\Search\Common\FieldValueMapper
Definition: Search/Common/FieldValueMapper/Aggregate.php:7
eZ\Publish\Core\Search\Elasticsearch\Content\FieldValueMapper
Definition: Elasticsearch/Content/FieldValueMapper/FloatMapper.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.