You are here

protected function FieldsProcessorPluginBase::processFieldValue in Search API 8

Processes a single text element in a field.

The default implementation just calls process().

Parameters

string $value: The string value to preprocess, as a reference. Can be manipulated directly, nothing has to be returned. Can either be left a string, or changed into an array of \Drupal\search_api\Plugin\search_api\data_type\value\TextTokenInterface objects. Returning anything else will result in undefined behavior.

string $type: The field's data type.

2 calls to FieldsProcessorPluginBase::processFieldValue()
FieldsProcessorPluginBase::processField in src/Processor/FieldsProcessorPluginBase.php
Processes a single field's value.
TestFieldsProcessorPlugin::processFieldValue in tests/src/Unit/Processor/TestFieldsProcessorPlugin.php
Processes a single text element in a field.
3 methods override FieldsProcessorPluginBase::processFieldValue()
HtmlFilter::processFieldValue in src/Plugin/search_api/processor/HtmlFilter.php
Processes a single text element in a field.
TestFieldsProcessorPlugin::processFieldValue in tests/src/Unit/Processor/TestFieldsProcessorPlugin.php
Processes a single text element in a field.
Tokenizer::processFieldValue in src/Plugin/search_api/processor/Tokenizer.php
Processes a single text element in a field.

File

src/Processor/FieldsProcessorPluginBase.php, line 510

Class

FieldsProcessorPluginBase
Provides a base class for processors that work on individual fields.

Namespace

Drupal\search_api\Processor

Code

protected function processFieldValue(&$value, $type) {
  if ($this
    ->shouldProcess($value)) {
    $this
      ->process($value);
  }
}