public function JobCheckoutManager::doBatchSubmitFinished

Batch submission finished callback.

File

src/JobCheckoutManager.php, line 303

Class

JobCheckoutManager
Provides functionality related to job checkout and submissions.

Namespace

Drupal\tmgmt

Code

public function doBatchSubmitFinished($success, $results, $operations) {
  if ($redirect = $this->jobQueue
    ->getNextUrl()) {

    // Proceed to the next redirect queue item, if there is one.
    return new RedirectResponse($redirect
      ->setAbsolute()
      ->toString());
  }
  elseif ($destination = $this->jobQueue
    ->getDestination()) {

    // Proceed to the defined destination if there is one.
    return new RedirectResponse(Url::fromUri('base:' . $destination)
      ->setAbsolute()
      ->toString());
  }
  else {

    // Per default we want to redirect the user to the overview.
    return new RedirectResponse(Url::fromRoute('view.tmgmt_job_overview.page_1')
      ->setAbsolute()
      ->toString());
  }
}