original_string: protected function setFinishDataErrors(array &$result, array &$job)
      {
          if (!empty($job['errors'])) {
  
              if (!empty($job['redirect']['errors'])) {
                  $result['redirect'] = $job['redirect']['errors'];
              }
  
              if (empty($job['redirect_message']['errors'])) {
                  $vars = array('%total' => $job['total'], '%errors' => $job['errors']);
                  $message = $this->translation->text('Processed %total items, errors: %errors', $vars);
              } else {
                  $vars = array('%total' => $job['total'], '%errors' => $job['errors'],
                      '%inserted' => $job['inserted'], '%updated' => $job['updated']);
                  $message = $this->translation->text($job['redirect_message']['errors'], $vars);
              }
  
              $this->session->setMessage($message, 'danger');
          }
      }
code: protected function setFinishDataErrors(array &$result, array &$job)
      {
          if (!empty($job['errors'])) {
  
              if (!empty($job['redirect']['errors'])) {
                  $result['redirect'] = $job['redirect']['errors'];
              }
  
              if (empty($job['redirect_message']['errors'])) {
                  $vars = array('%total' => $job['total'], '%errors' => $job['errors']);
                  $message = $this->translation->text('Processed %total items, errors: %errors', $vars);
              } else {
                  $vars = array('%total' => $job['total'], '%errors' => $job['errors'],
                      '%inserted' => $job['inserted'], '%updated' => $job['updated']);
                  $message = $this->translation->text($job['redirect_message']['errors'], $vars);
              }
  
              $this->session->setMessage($message, 'danger');
          }
      }
code_tokens: protected function setFinishDataErrors ( array & $ result , array & $ job ) { if ( ! empty ( $ job [ 'errors' ] ) ) { if ( ! empty ( $ job [ 'redirect' ] [ 'errors' ] ) ) { $ result [ 'redirect' ] = $ job [ 'redirect' ] [ 'errors' ] ; } if ( empty ( $ job [ 'redirect_message' ] [ 'errors' ] ) ) { $ vars = array ( '%total' => $ job [ 'total' ] , '%errors' => $ job [ 'errors' ] ) ; $ message = $ this -> translation -> text ( 'Processed %total items, errors: %errors' , $ vars ) ; } else { $ vars = array ( '%total' => $ job [ 'total' ] , '%errors' => $ job [ 'errors' ] , '%inserted' => $ job [ 'inserted' ] , '%updated' => $ job [ 'updated' ] ) ; $ message = $ this -> translation -> text ( $ job [ 'redirect_message' ] [ 'errors' ] , $ vars ) ; } $ this -> session -> setMessage ( $ message , 'danger' ) ; } }
docstring: Sets finish redirect and message when an error occurred
  @param array $result
  @param array $job
docstring_tokens: Sets finish redirect and message when an error occurred