You are here

public function SearchApiAbstractDataSourceController::stopTracking in Search API 7

Stops tracking of the index status of items for the given indexes.

The tracking tables of the given indexes should be completely cleared.

Parameters

SearchApiIndex[] $indexes: The SearchApiIndex objects for which item tracking should be stopped.

Throws

SearchApiDataSourceException If any error state was encountered.

Overrides SearchApiDataSourceControllerInterface::stopTracking

3 calls to SearchApiAbstractDataSourceController::stopTracking()
SearchApiAbstractDataSourceController::startTracking in includes/datasource.inc
Initializes tracking of the index status of items for the given indexes.
SearchApiCombinedEntityDataSourceController::startTracking in includes/datasource_multiple.inc
Initializes tracking of the index status of items for the given indexes.
SearchApiEntityDataSourceController::startTracking in includes/datasource_entity.inc
Initializes tracking of the index status of items for the given indexes.
1 method overrides SearchApiAbstractDataSourceController::stopTracking()
SearchApiExternalDataSourceController::stopTracking in includes/datasource_external.inc
Stop tracking of the index status of items for the given indexes.

File

includes/datasource.inc, line 577
Contains the SearchApiDataSourceControllerInterface as well as a default base class.

Class

SearchApiAbstractDataSourceController
Provides a default base class for datasource controllers.

Code

public function stopTracking(array $indexes) {
  if (!$this->table) {
    return;
  }

  // We could also use a single query with "IN" operator, but this method
  // will mostly be called with only one index.
  foreach ($indexes as $index) {
    $this
      ->checkIndex($index);
    db_delete($this->table)
      ->condition($this->indexIdColumn, $index->id)
      ->execute();
  }
}