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

Relation/SearchField.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\FieldType\Relation;
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 reset($field->value->data),
33 new Search\FieldType\StringField()
34 ),
35 ];
36 }
37
43 public function getIndexDefinition()
44 {
45 return [
46 'value' => new Search\FieldType\StringField(),
47 ];
48 }
49
59 public function getDefaultMatchField()
60 {
61 return 'value';
62 }
63
73 public function getDefaultSortField()
74 {
75 return $this->getDefaultMatchField();
76 }
77 }
eZ\Publish\API\Repository\Values\ContentType\FieldDefinition
Definition: API/Repository/Values/ContentType/FieldDefinition.php:31
eZ\Publish\Core\FieldType\FieldType
Base class for field types, the most basic storage unit of data inside eZ Publish.
Definition: Core/FieldType/FieldType.php:35
eZ\Publish\Core\FieldType\Relation\SearchField
Indexable definition for Relation field type.
Definition: Relation/SearchField.php:18
eZ\Publish\Core\FieldType\Relation\SearchField\getDefaultMatchField
getDefaultMatchField()
Get name of the default field to be used for matching.
Definition: Relation/SearchField.php:59
eZ\Publish\Core\FieldType\Relation\SearchField\getIndexDefinition
getIndexDefinition()
Get index field types for search backend.
Definition: Relation/SearchField.php:43
eZ\Publish\Core\FieldType\Relation\SearchField\getIndexData
getIndexData(Field $field, FieldDefinition $fieldDefinition)
Get index data for field for search backend.
Definition: Relation/SearchField.php:27
eZ\Publish\Core\FieldType\Relation\SearchField\getDefaultSortField
getDefaultSortField()
Get name of the default field to be used for sorting.
Definition: Relation/SearchField.php:73
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\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\Relation
Definition: Relation/NameableField.php:7
eZ\Publish\SPI\Search
Definition: Capable.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.