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

MultipleStringMapper.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Common\FieldValueMapper;
8
9 use eZ\Publish\SPI\Search\FieldType;
10 use eZ\Publish\SPI\Search\Field;
11
15 class MultipleStringMapper extends StringMapper
16 {
24 public function canMap(Field $field)
25 {
26 return
27 $field->type instanceof FieldType\MultipleStringField ||
28 $field->type instanceof FieldType\TextField ||
29 $field->type instanceof FieldType\FullTextField;
30 }
31
39 public function map(Field $field)
40 {
41 $values = [];
42
43 foreach ((array)$field->value as $value) {
44 $values[] = $this->convert($value);
45 }
46
47 return $values;
48 }
49 }
eZ\Publish\Core\Search\Common\FieldValueMapper\MultipleStringMapper
Common multiple string field value mapper implementation.
Definition: MultipleStringMapper.php:16
eZ\Publish\Core\Search\Common\FieldValueMapper\MultipleStringMapper\map
map(Field $field)
Map field value to a proper search engine representation.
Definition: MultipleStringMapper.php:39
eZ\Publish\Core\Search\Common\FieldValueMapper\MultipleStringMapper\canMap
canMap(Field $field)
Check if field can be mapped.
Definition: MultipleStringMapper.php:24
eZ\Publish\Core\Search\Common\FieldValueMapper\StringMapper
Common string field value mapper implementation.
Definition: StringMapper.php:17
eZ\Publish\Core\Search\Common\FieldValueMapper\StringMapper\convert
convert($value)
Convert to a proper search engine representation.
Definition: StringMapper.php:49
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\SPI\Search\FieldType
Definition: BooleanField.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.