division = $pwj->division; $this->charId = $pwj->charId; $this->page = $pwj->page; $this->delay = 15; $this->connection = 'database'; } /** * Execute the job. * Utilized by using ProcessWalletJournalJob::dispatch() * The model is passed into the dispatch function, then added to the queue * for processing. * * @return void */ public function handle() { //Declare the class variable we need $finance = new FinanceHelper(); $finance->GetWalletJournalPage($this->division, $this->charId, $this->page); //After the job is completed, delete the job $this->delete(); //If the job is completed, mark down the completed job in the status table for jobs $job = new JobStatus; $job->job_name = $this->getName(); $job->complete = true; $job->save(); } /** * The job failed to process. * * @param Exception $exception * @return void */ public function failed($exception) { //Save the error in the database $job = new JobStatus; $job->job_name = $this->getName(); $job->complete = false; $job->save(); //Save the job error $error = new JobError; $error->job_id = $job->id; $error->job_name = $this->getName(); $error->error = $exception; $error->save(); } }