Initial code base for new CSV import.

This commit is contained in:
James Cole
2016-06-10 21:00:00 +02:00
parent beda6ec3a9
commit 5a79bc0a99
21 changed files with 646 additions and 123 deletions

View File

@@ -31,6 +31,27 @@ class ExportJobServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->exportJob();
$this->importJob();
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
//
}
/**
*
*/
private function exportJob()
{
$this->app->bind(
'FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface',
function (Application $app, array $arguments) {
@@ -46,13 +67,20 @@ class ExportJobServiceProvider extends ServiceProvider
);
}
/**
* Register the application services.
*
* @return void
*/
public function register()
private function importJob()
{
//
$this->app->bind(
'FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface',
function (Application $app, array $arguments) {
if (!isset($arguments[0]) && $app->auth->check()) {
return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', [$app->auth->user()]);
}
if (!isset($arguments[0]) && !$app->auth->check()) {
throw new FireflyException('There is no user present.');
}
return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', $arguments);
}
);
}
}