You are here

public function FeedImportSQLHashes::insert in Feed Import 7.3

Inserts a new hash.

Parameters

integer $id: Entity id

mixed $hash: Unique hash coresponding to entity id

int $expire: Time to live

Overrides FeedImportHashManager::insert

File

feed_import_base/inc/feed_import.inc, line 1872
This file contains Feed Import helpers.

Class

FeedImportSQLHashes
This class implements SQL hash storage

Code

public function insert($id, $hash) {
  $this->insertFormat[3] = $id;
  $this->insertFormat[4] = $hash;
  $this->insertFormat[5] = $this->ttl ? $this->ttl + time() : 0;
  $this->insert
    ->values($this->insertFormat);

  // Commit insert.
  if (++$this->toInsert == $this->insertChunkSize) {
    $this
      ->insertCommit();
  }
}