Include warning for #722

This commit is contained in:
James Cole
2017-07-29 08:27:39 +02:00
parent f4994ef151
commit db3b822aef
8 changed files with 78 additions and 1 deletions

View File

@@ -48,6 +48,13 @@ interface ConfiguratorInterface
*/
public function getNextView(): string;
/**
* Return possible warning to user.
*
* @return string
*/
public function getWarningMessage(): string;
/**
* Returns true when the initial configuration for this job is complete.
*

View File

@@ -26,8 +26,12 @@ use Log;
*/
class CsvConfigurator implements ConfiguratorInterface
{
/** @var ImportJob */
private $job;
/** @var string */
private $warning = '';
/**
* ConfiguratorInterface constructor.
*/
@@ -50,8 +54,10 @@ class CsvConfigurator implements ConfiguratorInterface
/** @var ConfigurationInterface $object */
$object = new $class($this->job);
$object->setJob($job);
$result = $object->storeConfiguration($data);
$this->warning = $object->getWarningMessage();
return $object->storeConfiguration($data);
return $result;
}
/**
@@ -91,6 +97,16 @@ class CsvConfigurator implements ConfiguratorInterface
throw new FireflyException('No view for state');
}
/**
* Return possible warning to user.
*
* @return string
*/
public function getWarningMessage(): string
{
return $this->warning;
}
/**
* @return bool
*/