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

Common/FieldValueMapper/FloatMapper.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Common\FieldValueMapper;
8
9 use eZ\Publish\Core\Search\Common\FieldValueMapper;
10 use eZ\Publish\SPI\Search\FieldType\FloatField;
11 use eZ\Publish\SPI\Search\Field;
12
16 class FloatMapper extends FieldValueMapper
17 {
25 public function canMap(Field $field)
26 {
27 return $field->type instanceof FloatField;
28 }
29
37 public function map(Field $field)
38 {
39 return sprintf('%F', (float)$field->value);
40 }
41 }
eZ\Publish\Core\Search\Common\FieldValueMapper\FloatMapper
Common float field value mapper implementation.
Definition: Common/FieldValueMapper/FloatMapper.php:17
eZ\Publish\Core\Search\Common\FieldValueMapper\FloatMapper\map
map(Field $field)
Map field value to a proper search engine representation.
Definition: Common/FieldValueMapper/FloatMapper.php:37
eZ\Publish\Core\Search\Common\FieldValueMapper\FloatMapper\canMap
canMap(Field $field)
Check if field can be mapped.
Definition: Common/FieldValueMapper/FloatMapper.php:25
eZ\Publish\Core\Search\Common\FieldValueMapper
Maps raw field values to something search engine can understand.
Definition: FieldValueMapper.php:21
eZ\Publish\SPI\Search\FieldType\FloatField
Float document field.
Definition: FloatField.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
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.