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

MultipleBooleanMapper.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\MultipleBooleanField;
11 use eZ\Publish\SPI\Search\Field;
12
16 class MultipleBooleanMapper extends FieldValueMapper
17 {
25 public function canMap(Field $field)
26 {
27 return $field->type instanceof MultipleBooleanField;
28 }
29
37 public function map(Field $field)
38 {
39 $values = [];
40
41 foreach ((array)$field->value as $value) {
42 $values[] = (bool)$value;
43 }
44
45 return $values;
46 }
47 }
eZ\Publish\Core\Search\Common\FieldValueMapper\MultipleBooleanMapper
Common multiple boolean field value mapper implementation.
Definition: MultipleBooleanMapper.php:17
eZ\Publish\Core\Search\Common\FieldValueMapper\MultipleBooleanMapper\map
map(Field $field)
Map field value to a proper search engine representation.
Definition: MultipleBooleanMapper.php:37
eZ\Publish\Core\Search\Common\FieldValueMapper\MultipleBooleanMapper\canMap
canMap(Field $field)
Check if field can be mapped.
Definition: MultipleBooleanMapper.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\MultipleBooleanField
Boolean document field.
Definition: MultipleBooleanField.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+.