Various code clean up.

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-08-24 19:33:58 +02:00
parent 98c4ac955a
commit a2e14f8b8d
8 changed files with 175 additions and 85 deletions

View File

@@ -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
*/