Lots of new code for new importer routine.

This commit is contained in:
James Cole
2017-06-12 19:12:07 +02:00
parent 8beab5f5bc
commit 77244f4e2c
13 changed files with 542 additions and 88 deletions

View File

@@ -46,9 +46,10 @@ class CsvConfigurator implements ConfiguratorInterface
public function configureJob(array $data): bool
{
$class = $this->getConfigurationClass();
$job = $this->job;
/** @var ConfigurationInterface $object */
$object = new $class($this->job);
$object->setJob($job);
return $object->storeConfiguration($data);
}
@@ -62,9 +63,10 @@ class CsvConfigurator implements ConfiguratorInterface
public function getNextData(): array
{
$class = $this->getConfigurationClass();
$job = $this->job;
/** @var ConfigurationInterface $object */
$object = new $class($this->job);
$object = app($class);
$object->setJob($job);
return $object->getData();
@@ -128,7 +130,7 @@ class CsvConfigurator implements ConfiguratorInterface
break;
}
if ($class === false) {
if ($class === false || strlen($class) === 0) {
throw new FireflyException('Cannot handle current job state in getConfigurationClass().');
}
if (!class_exists($class)) {