public static function Utility::splitCombinedId in Search API 8
Splits an internal ID into its two parts.
Both internal item IDs and combined property paths are prefixed with the corresponding datasource ID. This method will split these IDs up again into their two parts.
Parameters
string $combined_id: The internal ID, with an optional datasource prefix separated with \Drupal\search_api\IndexInterface::DATASOURCE_ID_SEPARATOR from the raw item ID or property path.
Return value
array A numeric array, containing the datasource ID in element 0 and the raw item ID or property path in element 1. In the case of datasource-independent properties (that is, when there is no prefix), element 0 will be NULL.
18 calls to Utility::splitCombinedId()
- AggregatedFieldProperty::buildConfigurationForm in src/
Plugin/ search_api/ processor/ Property/ AggregatedFieldProperty.php - Constructs a configuration form for a field based on this property.
- AggregatedFieldProperty::getFieldDescription in src/
Plugin/ search_api/ processor/ Property/ AggregatedFieldProperty.php - Retrieves the description for a field based on this property.
- AggregatedFields::addFieldValues in src/
Plugin/ search_api/ processor/ AggregatedFields.php - Adds the values of properties defined by this processor to the item.
- BackendTest::regressionTest2926733 in modules/
search_api_db/ tests/ src/ Kernel/ BackendTest.php - Tests indexing of text tokens with leading/trailing whitespace.
- Basic::trackItemsInserted in src/
Plugin/ search_api/ tracker/ Basic.php - Inserts new items into the tracking system for this index.
File
- src/
Utility/ Utility.php, line 111
Class
- Utility
- Contains utility methods for the Search API.
Namespace
Drupal\search_api\UtilityCode
public static function splitCombinedId($combined_id) {
if (strpos($combined_id, IndexInterface::DATASOURCE_ID_SEPARATOR) !== FALSE) {
return explode(IndexInterface::DATASOURCE_ID_SEPARATOR, $combined_id, 2);
}
return [
NULL,
$combined_id,
];
}