Massive rewrite for import routine, part 1.

This commit is contained in:
James Cole
2017-12-16 08:03:35 +01:00
parent 985cc100e2
commit 84b6708260
34 changed files with 671 additions and 244 deletions

View File

@@ -20,7 +20,7 @@
*/
declare(strict_types=1);
namespace FireflyIII\Support\Import\Configuration\Csv;
namespace FireflyIII\Support\Import\Configuration\File;
use ExpandedForm;
use FireflyIII\Models\AccountType;

View File

@@ -20,7 +20,7 @@
*/
declare(strict_types=1);
namespace FireflyIII\Support\Import\Configuration\Csv;
namespace FireflyIII\Support\Import\Configuration\File;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Import\Mapper\MapperInterface;

View File

@@ -20,7 +20,7 @@
*/
declare(strict_types=1);
namespace FireflyIII\Support\Import\Configuration\Csv;
namespace FireflyIII\Support\Import\Configuration\File;
use FireflyIII\Import\Specifics\SpecificInterface;
use FireflyIII\Models\ImportJob;

View File

@@ -0,0 +1,89 @@
<?php
/**
* Upload.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Support\Import\Configuration\File;
use FireflyIII\Import\Specifics\SpecificInterface;
use FireflyIII\Models\ImportJob;
use FireflyIII\Support\Import\Configuration\ConfigurationInterface;
use League\Csv\Reader;
use League\Csv\Statement;
use Log;
/**
* Class Upload.
*/
class Upload implements ConfigurationInterface
{
/** @var ImportJob */
private $job;
/** @var string */
private $warning = '';
/**
* Get the data necessary to show the configuration screen.
*
* @return array
*/
public function getData(): array
{
return [];
}
/**
* Return possible warning to user.
*
* @return string
*/
public function getWarningMessage(): string
{
return $this->warning;
}
/**
* @param ImportJob $job
*
* @return ConfigurationInterface
*/
public function setJob(ImportJob $job): ConfigurationInterface
{
$this->job = $job;
return $this;
}
/**
* Store the result.
*
* @param array $data
*
* @return bool
*/
public function storeConfiguration(array $data): bool
{
echo 'do something with data.';
exit;
return true;
}
}