You are here

abstract class FeedImportHashManager in Feed Import 8

Class which provides methods to manage hashes.

Hierarchy

Expanded class hierarchy of FeedImportHashManager

File

feed_import_base/src/FeedImportHashManager.php, line 7

Namespace

Drupal\feed_import_base
View source
abstract class FeedImportHashManager extends FeedImportConfigurable implements FeedImportStaticHashManager {

  // Expire entities.
  protected $ttl = 0;

  // Generated hashes.
  protected $generatedHashes = array();

  // Item is marked as protected for updates.
  const MARK_PROTECTED = 1;

  /**
   * Constructor.
   */
  public abstract function __construct($entity_name, $feed_machine_name);

  /**
   * Returns an array of entity keyed by hash,
   * using generated hashes.
   *
   * @return array
   *     An array containing entity ids keyed by hash.
   */
  public abstract function get();

  /**
   * Inserts a new hash.
   *
   * @param integer $id
   *     Entity id
   * @param mixed $hash
   *     Unique hash coresponding to entity id
   * @param int $expire
   *     Time to live
   */
  public abstract function insert($id, $hash);

  /**
   * Commits the insert to storage.
   */
  public abstract function insertCommit();

  /**
   * Updates hashes.
   *
   * @param integer $id
   *     Hash id
   * @param int $expire
   *     Time to live
   */
  public abstract function update($id);

  /**
   * Protects a hash for updates
   *
   * @param integer $id
   *    Hash id
   */
  public abstract function protect($id);

  /**
   * Commits the update to storage.
   */
  public abstract function updateCommit();

  /**
   * Creates a hash, based on uniq
   * Also adds it on generated hashes
   *
   * @param mixed $uniq
   *     Unique identifier.
   *
   * @return string
   *     A hash for specified identifier.
   */
  public abstract function hash(&$uniq);

}

Members

Namesort descending Modifiers Type Description Overrides
FeedImportConfigurable::$options protected property
FeedImportConfigurable::cleanLines public static function Helper function to get lines of a string
FeedImportConfigurable::setOptions public function Sets options for this instance 4
FeedImportHashManager::$generatedHashes protected property
FeedImportHashManager::$ttl protected property
FeedImportHashManager::get abstract public function Returns an array of entity keyed by hash, using generated hashes. 1
FeedImportHashManager::hash abstract public function Creates a hash, based on uniq Also adds it on generated hashes 1
FeedImportHashManager::insert abstract public function Inserts a new hash. 1
FeedImportHashManager::insertCommit abstract public function Commits the insert to storage. 1
FeedImportHashManager::MARK_PROTECTED constant
FeedImportHashManager::protect abstract public function Protects a hash for updates 1
FeedImportHashManager::update abstract public function Updates hashes. 1
FeedImportHashManager::updateCommit abstract public function Commits the update to storage. 1
FeedImportHashManager::__construct abstract public function Constructor. 1
FeedImportStaticHashManager::delete public static function Deletes hashes from database. 1
FeedImportStaticHashManager::deleteByFeed public static function Deletes all hashes for specified feed name 1
FeedImportStaticHashManager::deleteByGroup public static function Deletes all hashes of specified group 1
FeedImportStaticHashManager::deleteEntities public static function Deletes entities by type and id 1
FeedImportStaticHashManager::getExpired public static function Returns an array of expired entity ids keyed by entity name 1
FeedImportStaticHashManager::rescheduleAll public static function Reschedules all entities 1
FeedImportStaticHashManager::totalHashes public static function Returns total number of hashes for desired feeds. 1