You are here

protected function SearchApiEtTestCase::itemIdExists in Search API Entity Translation 7.2

Checks if a Search API Entity translation item id is indexed.

Parameters

string $item_id: A Search API Entity translation id, eg. 2/en.

Return value

bool TRUE if an item_id exists, otherwise FALSE.

1 call to SearchApiEtTestCase::itemIdExists()
SearchApiEtTestCase::testIndex in tests/search_api_et.test
Tests adding, updating and deleting multilingual Search API items.

File

tests/search_api_et.test, line 128
Tests for Search API Entity Translation.

Class

SearchApiEtTestCase
Tests adding, updating and deleting multilingual Search API items.

Code

protected function itemIdExists($item_id) {
  $result = db_select('search_api_et_item', 's')
    ->fields('s', array(
    'item_id',
  ))
    ->condition('s.item_id', $item_id)
    ->execute()
    ->fetchField();
  return $result === $item_id;
}