You are here

protected function TestFieldsProcessorPlugin::shouldProcess in Search API 8

Determines whether a single value (not an array) should be processed.

The default implementation returns TRUE if and only if the value is a string.

Parameters

mixed $value: The value. For instance, a field or condition value.

Return value

bool TRUE if process() should be called on the given value, FALSE otherwise.

Overrides FieldsProcessorPluginBase::shouldProcess

See also

\Drupal\search_api\Processor\FieldsProcessorPluginBase::process()

File

tests/src/Unit/Processor/TestFieldsProcessorPlugin.php, line 122

Class

TestFieldsProcessorPlugin
Mimics a processor working on individual fields of items.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

protected function shouldProcess($value) : bool {
  if (isset($this->methodOverrides[__FUNCTION__])) {
    return $this->methodOverrides[__FUNCTION__]($value);
  }
  return parent::shouldProcess($value);
}