You are here

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

Checks if a Search API item is not indexed on the backend.

Parameters

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

Return value

bool TRUE if an item_id exists, otherwise FALSE.

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

File

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

Class

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

Code

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