You are here

protected function SearchApiSolrMultilingualTest::getItemIds in Search API Solr 8.2

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/SearchApiSolrMultilingualTest.php, line 282

Class

SearchApiSolrMultilingualTest
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;
}