mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Expand import routine to work over command line.
This commit is contained in:
@@ -55,6 +55,30 @@ class FileRoutine implements RoutineInterface
|
||||
$this->errors = new Collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getErrors(): Collection
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getJournals(): Collection
|
||||
{
|
||||
return $this->journals;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLines(): int
|
||||
{
|
||||
return $this->lines;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -111,7 +135,7 @@ class FileRoutine implements RoutineInterface
|
||||
{
|
||||
$objects = new Collection;
|
||||
$config = $this->job->configuration;
|
||||
$fileType = $config['file-type'];
|
||||
$fileType = $config['file-type'] ?? 'csv';
|
||||
// will only respond to "file"
|
||||
$class = config(sprintf('import.options.file.processors.%s', $fileType));
|
||||
/** @var FileProcessorInterface $processor */
|
||||
|
@@ -22,18 +22,26 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Import\Routine;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use FireflyIII\Import\FileProcessor\FileProcessorInterface;
|
||||
use FireflyIII\Import\Storage\ImportStorage;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
interface RoutineInterface
|
||||
{
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getErrors(): Collection;
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getJournals(): Collection;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLines(): int;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
@@ -45,4 +53,6 @@ interface RoutineInterface
|
||||
* @return mixed
|
||||
*/
|
||||
public function setJob(ImportJob $job);
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user