You are here

public function SearchApiAbstractDataSourceController::trackItemQueued in Search API 7

Sets the tracking status of the given items to "queued".

Queued items are not marked as "dirty" even when they are changed, and they are not returned by the getChangedItems() method.

Parameters

array|false $item_ids: Either an array with the IDs of the queued items. Or FALSE to mark all items as queued for the given indexes.

SearchApiIndex $index: The index for which the items were queued.

Throws

SearchApiDataSourceException If any error state was encountered.

Overrides SearchApiDataSourceControllerInterface::trackItemQueued

Deprecated

As of Search API 1.10, the cron queue is not used for indexing anymore, therefore this method has become useless. It will be removed in the Drupal 8 version of this module.

File

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

Class

SearchApiAbstractDataSourceController
Provides a default base class for datasource controllers.

Code

public function trackItemQueued($item_ids, SearchApiIndex $index) {
  $this
    ->checkIndex($index);
  if (!$this->table || $item_ids === array()) {
    return;
  }
  $update = db_update($this->table)
    ->fields(array(
    $this->changedColumn => -1,
  ))
    ->condition($this->indexIdColumn, $index->id);
  if ($item_ids !== FALSE) {
    $update
      ->condition($this->itemIdColumn, $item_ids, 'IN');
  }
  $update
    ->execute();
}