mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 17:31:09 -06:00
Extend ImportObject with row hash.
This commit is contained in:
parent
e440d55034
commit
117bb602dc
@ -32,6 +32,8 @@ class ImportEntry
|
||||
public $externalID;
|
||||
/** @var array */
|
||||
public $fields = [];
|
||||
/** @var string */
|
||||
public $hash;
|
||||
/** @var User */
|
||||
public $user;
|
||||
/** @var bool */
|
||||
@ -77,6 +79,10 @@ class ImportEntry
|
||||
default:
|
||||
Log::error('Import entry cannot handle object.', ['role' => $role]);
|
||||
throw new FireflyException('Import entry cannot handle object of type "' . $role . '".');
|
||||
case 'hash':
|
||||
$this->hash = $convertedValue;
|
||||
|
||||
return;
|
||||
case 'amount':
|
||||
/*
|
||||
* Easy enough.
|
||||
|
@ -100,6 +100,10 @@ class CsvImporter implements ImporterInterface
|
||||
$object->setUser($this->job->user);
|
||||
$config = $this->job->configuration;
|
||||
|
||||
// hash the row:
|
||||
$hash = hash('sha256', json_encode($row));
|
||||
$object->importValue('hash', 100, $hash);
|
||||
|
||||
// and this is the point where the specifix go to work.
|
||||
foreach ($config['specifics'] as $name => $enabled) {
|
||||
/** @var SpecificInterface $specific */
|
||||
|
Loading…
Reference in New Issue
Block a user