You are here

protected function ExampleContentTrait::getItemIds in Search API 8

Returns the item IDs for the given entity IDs.

Parameters

array $entity_ids: An array of entity IDs.

Return value

string[] An array of item IDs.

4 calls to ExampleContentTrait::getItemIds()
BackendTest::searchSuccessMinChars in modules/search_api_db/tests/src/Kernel/BackendTest.php
Tests the results of some test searches with minimum word length of 4.
BackendTest::searchWithRandom in modules/search_api_db/tests/src/Kernel/BackendTest.php
Tests whether random searches work.
BackendTestBase::assertResults in tests/src/Kernel/BackendTestBase.php
Asserts that the given result set complies with expectations.
BackendTestBase::searchSuccess in tests/src/Kernel/BackendTestBase.php
Tests whether some test searches have the correct results.
1 method overrides ExampleContentTrait::getItemIds()
ContentEntityDatasourceTest::getItemIds in tests/src/Kernel/Datasource/ContentEntityDatasourceTest.php
Retrieves the IDs of all matching items from the test datasource.

File

tests/src/Functional/ExampleContentTrait.php, line 142

Class

ExampleContentTrait
Contains helpers to create data that can be used by tests.

Namespace

Drupal\Tests\search_api\Functional

Code

protected function getItemIds(array $entity_ids) {
  $map = $this->ids;
  $translate_ids = function ($entity_id) use ($map) {
    return $map[$entity_id];
  };
  return array_map($translate_ids, $entity_ids);
}