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

Price/SearchField.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\FieldType\Price;
8
9 use eZ\Publish\SPI\Persistence\Content\Field;
10 use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition;
11 use eZ\Publish\SPI\FieldType\Indexable;
12 use eZ\Publish\SPI\Search;
13
17 class SearchField implements Indexable
18 {
27 public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
28 {
29 return [
30 new Search\Field(
31 'value',
32 // @todo: Data is yet empty, this seems wrong, so we use the
33 // sort field for now
34 $field->value->sortKey['sort_key_int'] / 1000,
35 new Search\FieldType\PriceField()
36 ),
37 new Search\Field(
38 'fulltext',
39 $field->value->sortKey['sort_key_int'] / 1000,
40 new Search\FieldType\FullTextField()
41 ),
42 ];
43 }
44
50 public function getIndexDefinition()
51 {
52 return [
53 'value' => new Search\FieldType\PriceField(),
54 ];
55 }
56
66 public function getDefaultMatchField()
67 {
68 return 'value';
69 }
70
80 public function getDefaultSortField()
81 {
82 return $this->getDefaultMatchField();
83 }
84 }
eZ\Publish\Core\FieldType\Price\SearchField
Indexable definition for string field type.
Definition: Price/SearchField.php:18
eZ\Publish\Core\FieldType\Price\SearchField\getDefaultSortField
getDefaultSortField()
Get name of the default field to be used for sorting.
Definition: Price/SearchField.php:80
eZ\Publish\Core\FieldType\Price\SearchField\getIndexDefinition
getIndexDefinition()
Get index field types for search backend.
Definition: Price/SearchField.php:50
eZ\Publish\Core\FieldType\Price\SearchField\getIndexData
getIndexData(Field $field, FieldDefinition $fieldDefinition)
Get index data for field for search backend.
Definition: Price/SearchField.php:27
eZ\Publish\Core\FieldType\Price\SearchField\getDefaultMatchField
getDefaultMatchField()
Get name of the default field to be used for matching.
Definition: Price/SearchField.php:66
eZ\Publish\SPI\Persistence\Content\Field
Definition: SPI/Persistence/Content/Field.php:12
eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
Definition: SPI/Persistence/Content/Type/FieldDefinition.php:18
eZ\Publish\SPI\Search\FieldType
Definition: SPI/Search/FieldType.php:17
eZ\Publish\SPI\FieldType\Indexable
The field type interface which all field types have to implement to be indexable by search backends.
Definition: Indexable.php:17
eZ\Publish\Core\FieldType\Price
Definition: Price/SearchField.php:7
eZ\Publish\SPI\Search
Definition: Capable.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.