mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 10:47:00 +00:00 
			
		
		
		
	Expand some code for Spectre import.
This commit is contained in:
		| @@ -42,6 +42,20 @@ class ImportJobRepository implements ImportJobRepositoryInterface | ||||
|     /** @var User */ | ||||
|     private $user; | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $index | ||||
|      * @param string    $error | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function addError(ImportJob $job, int $index, string $error): ImportJob | ||||
|     { | ||||
|         $job->addError($index, $error); | ||||
|  | ||||
|         return $job; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $steps | ||||
| @@ -277,6 +291,46 @@ class ImportJobRepository implements ImportJobRepositoryInterface | ||||
|         return $job; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param string    $status | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function setStatus(ImportJob $job, string $status): ImportJob | ||||
|     { | ||||
|         $job->status = $status; | ||||
|         $job->save(); | ||||
|  | ||||
|         return $job; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $count | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function setStepsDone(ImportJob $job, int $steps): ImportJob | ||||
|     { | ||||
|         $job->setStepsDone($steps); | ||||
|  | ||||
|         return $job; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $count | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function setTotalSteps(ImportJob $job, int $count): ImportJob | ||||
|     { | ||||
|         $job->setTotalSteps($count); | ||||
|  | ||||
|         return $job; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param User $user | ||||
|      */ | ||||
| @@ -311,30 +365,4 @@ class ImportJobRepository implements ImportJobRepositoryInterface | ||||
|     { | ||||
|         return $job->uploadFileContents(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $count | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function setStepsDone(ImportJob $job, int $steps): ImportJob | ||||
|     { | ||||
|         $job->setStepsDone($steps); | ||||
|  | ||||
|         return $job; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $count | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function setTotalSteps(ImportJob $job, int $count): ImportJob | ||||
|     { | ||||
|         $job->setTotalSteps($count); | ||||
|  | ||||
|         return $job; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -32,6 +32,15 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; | ||||
| interface ImportJobRepositoryInterface | ||||
| { | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $index | ||||
|      * @param string    $error | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function addError(ImportJob $job, int $index, string $error): ImportJob; | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $steps | ||||
| @@ -113,6 +122,14 @@ interface ImportJobRepositoryInterface | ||||
|      */ | ||||
|     public function setExtendedStatus(ImportJob $job, array $array): ImportJob; | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param string    $status | ||||
|      * | ||||
|      * @return ImportJob | ||||
|      */ | ||||
|     public function setStatus(ImportJob $job, string $status): ImportJob; | ||||
|  | ||||
|     /** | ||||
|      * @param ImportJob $job | ||||
|      * @param int       $count | ||||
|   | ||||
		Reference in New Issue
	
	Block a user