You are here

public function Basic::getRemainingItems in Search API 8

Retrieves a list of item IDs that need to be indexed.

Parameters

int $limit: (optional) The maximum number of items to return. Or a negative value to return all remaining items.

string|null $datasource_id: (optional) If specified, only items of the datasource with that ID are retrieved.

Return value

string[] The IDs of items that still need to be indexed.

Overrides TrackerInterface::getRemainingItems

File

src/Plugin/search_api/tracker/Basic.php, line 361

Class

Basic
Provides a tracker implementation which uses a FIFO-like processing order.

Namespace

Drupal\search_api\Plugin\search_api\tracker

Code

public function getRemainingItems($limit = -1, $datasource_id = NULL) {
  try {
    $select = $this
      ->createRemainingItemsStatement($datasource_id);
    if ($limit >= 0) {
      $select
        ->range(0, $limit);
    }
    return $select
      ->execute()
      ->fetchCol();
  } catch (\Exception $e) {
    $this
      ->logException($e);
    return [];
  }
}