original_string: public function setJob($job_model)
      {
          if ($this->isCanceledJob($job_model)) {
              return null;
          }
  
          $job_id = $this->getQuery('job_id');
  
          if (empty($job_id)) {
              return null;
          }
  
          $job = $job_model->get($job_id);
  
          if (empty($job['status'])) {
              return null;
          }
  
          $this->setJsSettings('job', $job);
  
          if ($this->getQuery('process_job') === $job['id'] && $this->isAjax()) {
              $this->outputJson($job_model->process($job));
          }
  
          return null;
      }
code: public function setJob($job_model)
      {
          if ($this->isCanceledJob($job_model)) {
              return null;
          }
  
          $job_id = $this->getQuery('job_id');
  
          if (empty($job_id)) {
              return null;
          }
  
          $job = $job_model->get($job_id);
  
          if (empty($job['status'])) {
              return null;
          }
  
          $this->setJsSettings('job', $job);
  
          if ($this->getQuery('process_job') === $job['id'] && $this->isAjax()) {
              $this->outputJson($job_model->process($job));
          }
  
          return null;
      }
code_tokens: public function setJob ( $ job_model ) { if ( $ this -> isCanceledJob ( $ job_model ) ) { return null ; } $ job_id = $ this -> getQuery ( 'job_id' ) ; if ( empty ( $ job_id ) ) { return null ; } $ job = $ job_model -> get ( $ job_id ) ; if ( empty ( $ job [ 'status' ] ) ) { return null ; } $ this -> setJsSettings ( 'job' , $ job ) ; if ( $ this -> getQuery ( 'process_job' ) === $ job [ 'id' ] && $ this -> isAjax ( ) ) { $ this -> outputJson ( $ job_model -> process ( $ job ) ) ; } return null ; }
docstring: Processes the current job
  @param \gplcart\core\models\Job $job_model
  @return null
docstring_tokens: Processes the current job