mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 02:03:40 +00:00
Various code clean up.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -45,6 +45,15 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
class ImportJob extends Model
|
||||
{
|
||||
|
||||
protected $validStatus
|
||||
= [
|
||||
'import_status_never_started', // initial state
|
||||
'import_configuration_saved', // import configuration saved. This step is going to be obsolete.
|
||||
'settings_complete', // aka: ready for import.
|
||||
'import_running', // import currently underway
|
||||
'import_complete', // done with everything
|
||||
];
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
*
|
||||
@@ -139,6 +148,16 @@ class ImportJob extends Model
|
||||
$this->attributes['extended_status'] = json_encode($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
*/
|
||||
public function setStatusAttribute(string $value)
|
||||
{
|
||||
if (in_array($value, $this->validStatus)) {
|
||||
$this->attributes['status'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
Reference in New Issue
Block a user