You are here

protected function SearchApiSolrTest::getItemIds in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::getItemIds()

If the list of entity ids contains language codes it will be handled here, otherwise it will be handed over to the parent implementation.

Parameters

array $entity_ids: An array of entity IDs or an array keyed by entity IDs and langcodes as values.

Return value

string[] An array of item IDs.

Overrides ExampleContentTrait::getItemIds

File

tests/src/Kernel/SearchApiSolrTest.php, line 1301

Class

SearchApiSolrTest
Tests index and search capabilities using the Solr search backend.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

protected function getItemIds(array $entity_ids) {
  $item_ids = [];
  if (!empty($entity_ids)) {
    $keys = array_keys($entity_ids);
    $first_key = reset($keys);
    if (0 === $first_key) {
      return parent::getItemIds($entity_ids);
    }
    else {
      foreach ($entity_ids as $id => $langcode) {
        $item_ids[] = Utility::createCombinedId('entity:entity_test_mulrev_changed', $id . ':' . $langcode);
      }
    }
  }
  return $item_ids;
}