You are here

protected function SearchApiFieldTrait::createCombinedPropertyPath in Search API 8

Creates a combined property path.

A combined property path is similar to a "combined ID" in that it contains information about both the datasource and the property path on that datasource.

The difference is that a combined property path, as used in this class, can be NULL (to reference the original result item).

Parameters

string|null $datasource_id: The datasource ID, or NULL for a datasource-independent property.

string|null $property_path: The property path from the result item to the specified property, or NULL to reference the result item.

Return value

string|null The combined property path.

4 calls to SearchApiFieldTrait::createCombinedPropertyPath()
SearchApiEntityField::getItems in src/Plugin/views/field/SearchApiEntityField.php
Gets an array of items for the field.
SearchApiFieldTrait::expandRequiredProperties in src/Plugin/views/field/SearchApiFieldTrait.php
Expands the properties to retrieve for this field.
SearchApiFieldTrait::getEntity in src/Plugin/views/field/SearchApiFieldTrait.php
Gets the entity matching the current row and relationship.
SearchApiFieldTrait::getValuesToExtract in src/Plugin/views/field/SearchApiFieldTrait.php
Determines and prepares the property values that need to be extracted.

File

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

Class

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

Namespace

Drupal\search_api\Plugin\views\field

Code

protected function createCombinedPropertyPath($datasource_id, $property_path) {
  if ($property_path === NULL) {
    return NULL;
  }
  return Utility::createCombinedId($datasource_id, $property_path);
}