You are here

public function SearchApiFieldTrait::getDatasourceId in Search API 8

Retrieves the ID of the datasource to which this field belongs.

Return value

string|null The datasource ID of this field, or NULL if it doesn't belong to a specific datasource.

3 calls to SearchApiFieldTrait::getDatasourceId()
SearchApiEntityField::getItems in src/Plugin/views/field/SearchApiEntityField.php
Gets an array of items for the field.
SearchApiEntityField::query in src/Plugin/views/field/SearchApiEntityField.php
Add anything to the query that we might need to.
SearchApiFieldTrait::isActiveForRow in src/Plugin/views/field/SearchApiFieldTrait.php
Determines whether this field is active for the given row.

File

src/Plugin/views/field/SearchApiFieldTrait.php, line 1148

Class

SearchApiFieldTrait
Provides a trait to use for Search API Views field handlers.

Namespace

Drupal\search_api\Plugin\views\field

Code

public function getDatasourceId() {
  if (!isset($this->datasourceId)) {
    list($this->datasourceId) = Utility::splitCombinedId($this
      ->getCombinedPropertyPath());
  }
  return $this->datasourceId;
}