protected function SearchApiEtTestCase::itemIdExistsOnBackend in Search API Entity Translation 7.2
Checks if a Search API Entity item is 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::itemIdExistsOnBackend()
- SearchApiEtTestCase::testIndex in tests/
search_api_et.test - Tests adding, updating and deleting multilingual Search API items.
File
- tests/
search_api_et.test, line 147 - Tests for Search API Entity Translation.
Class
- SearchApiEtTestCase
- Tests adding, updating and deleting multilingual Search API items.
Code
protected function itemIdExistsOnBackend($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 $result === $item_id;
}