You are here

protected function SearchApiAbstractProcessor::testField in Search API 7

Determines whether to process data from the given field.

Parameters

$name: The field's machine name.

array $field: The field's information.

Return value

bool TRUE, if the field should be processed, FALSE otherwise.

3 calls to SearchApiAbstractProcessor::testField()
SearchApiAbstractProcessor::configurationForm in includes/processor.inc
Display a form for configuring this processor. Since forcing users to specify options for disabled processors makes no sense, none of the form elements should have the '#required' attribute set.
SearchApiAbstractProcessor::preprocessIndexItems in includes/processor.inc
Calls processField() for all appropriate fields.
SearchApiAbstractProcessor::processFilters in includes/processor.inc
Method for preprocessing query filters.

File

includes/processor.inc, line 403
Contains SearchApiProcessorInterface and SearchApiAbstractProcessor.

Class

SearchApiAbstractProcessor
Abstract processor implementation that provides an easy framework for only processing specific fields.

Code

protected function testField($name, array $field) {
  if (empty($this->options['fields'])) {
    return $this
      ->testType($field['type']);
  }
  return !empty($this->options['fields'][$name]);
}