You are here

public function ItemInterface::getField in Search API 8

Retrieves a single field of this item.

Parameters

string $field_id: The identifier of the field to retrieve.

bool $extract: (optional) If FALSE, only returns the field if it was previously set or extracted. Defaults to extracting all fields from the original object if necessary.

Return value

\Drupal\search_api\Item\FieldInterface|null The field object with this identifier, or NULL if the field is unknown.

1 method overrides ItemInterface::getField()
Item::getField in src/Item/Item.php
Retrieves a single field of this item.

File

src/Item/ItemInterface.php, line 107

Class

ItemInterface
Represents a search item being indexed or returned as a search result.

Namespace

Drupal\search_api\Item

Code

public function getField($field_id, $extract = TRUE);