You are here

public function FeedImportSQLHashes::get in Feed Import 8

Returns an array of entity keyed by hash, using generated hashes.

Return value

array An array containing entity ids keyed by hash.

Overrides FeedImportHashManager::get

File

feed_import_base/src/FeedImportSQLHashes.php, line 94

Class

FeedImportSQLHashes
This class implements SQL hash storage

Namespace

Drupal\feed_import_base

Code

public function get() {
  if (!$this->generatedHashes) {
    return array();
  }

  // Get select conditions (reuse same select object).
  $cond =& $this->select
    ->conditions();

  // Remove last condition.
  array_pop($cond);

  // Return hashes.
  $hashes = $this->select
    ->condition('hash', $this->generatedHashes, 'IN')
    ->execute()
    ->fetchAllAssoc('hash');
  $this->generatedHashes = array();
  return $hashes;
}