You are here

public function SolrDocument::getItemLabel in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/datasource/SolrDocument.php \Drupal\search_api_solr\Plugin\search_api\datasource\SolrDocument::getItemLabel()
  2. 4.x src/Plugin/search_api/datasource/SolrDocument.php \Drupal\search_api_solr\Plugin\search_api\datasource\SolrDocument::getItemLabel()

Retrieves a human-readable label for an item.

Parameters

\Drupal\Core\TypedData\ComplexDataInterface $item: An item of this controller's type.

Return value

string|null Either a human-readable label for the item, or NULL if none is available.

Overrides DatasourcePluginBase::getItemLabel

File

src/Plugin/search_api/datasource/SolrDocument.php, line 114

Class

SolrDocument
Represents a datasource which exposes external Solr Documents.

Namespace

Drupal\search_api_solr\Plugin\search_api\datasource

Code

public function getItemLabel(ComplexDataInterface $item) {
  return $this
    ->getFieldValue($item, 'label_field');
}