public function SearchApiFieldTrait::getValue in Search API 8
Retrieves the value that's supposed to be rendered.
This API exists so that other modules can easily set the values of the field without having the need to change the render method as well.
Overridden here to provide an easy way to let this method return arbitrary values, without actually touching the $values array.
Parameters
\Drupal\views\ResultRow $values: An object containing all retrieved values.
string $field: Optional name of the field where the value is stored.
Return value
mixed The field value to use.
See also
\Drupal\views\Plugin\views\field\FieldHandlerInterface::getValue()
File
- src/
Plugin/ views/ field/ SearchApiFieldTrait.php, line 437
Class
- SearchApiFieldTrait
- Provides a trait to use for Search API Views field handlers.
Namespace
Drupal\search_api\Plugin\views\fieldCode
public function getValue(ResultRow $values, $field = NULL) {
return $this->overriddenValues[$field] ?? parent::getValue($values, $field);
}