You are here

FeedImportSQLHashesv2Compatible.php in Feed Import 8

File

feed_import_base/src/FeedImportSQLHashesv2Compatible.php
View source
<?php

namespace Drupal\feed_import_base;


/**
 * This class implements SQL hash storage compatible with version 2.x
 */
class FeedImportSQLHashesv2Compatible extends FeedImportSQLHashes {

  // Used to generate hash.
  protected $hashPart;

  /**
   * {@inheritdoc}
   */
  public function hash(&$uniq) {
    return $this->generatedHashes[] = md5($uniq . $this->hashPart);
  }

  /**
   * {@inheritdoc}
   */
  public function setOptions(array $options, $overwrite = FALSE) {
    parent::setOptions($options, $overwrite);
    $this->hashPart = '/' . $this->group . '/' . $this->entity;
  }

}

Classes

Namesort descending Description
FeedImportSQLHashesv2Compatible This class implements SQL hash storage compatible with version 2.x