You are here

public function FieldsHelperInterface::extractItemValues in Search API 8

Extracts property values from items.

Values are taken from existing fields on the item, where present, and are otherwise extracted from the item's underlying object.

Parameters

\Drupal\search_api\Item\ItemInterface[] $items: The items from which properties should be extracted.

string[][] $required_properties: The properties that should be extracted, keyed by datasource ID and property path, with the values being the IDs that the values should be put under in the return value.

bool $load: (optional) If FALSE, only field values already present will be returned. Otherwise, fields will be extracted (and underlying objects loaded) if necessary.

Return value

mixed[][][] Arrays of field values, keyed by items' indexes in $items and the given field IDs from $required_properties.

1 method overrides FieldsHelperInterface::extractItemValues()
FieldsHelper::extractItemValues in src/Utility/FieldsHelper.php
Extracts property values from items.

File

src/Utility/FieldsHelperInterface.php, line 76

Class

FieldsHelperInterface
Provides an interface for implementations of the fields helper service.

Namespace

Drupal\search_api\Utility

Code

public function extractItemValues(array $items, array $required_properties, $load = TRUE);