You are here

function progress_get_progress in Background Process 8

Get progress.

6 calls to progress_get_progress()
BackgroundBatchContext::offsetSet in background_batch/src/BackgroundBatchContext.php
Implements to Update progress if needed.
BackgroundProcess::sendMessage in ./background_process.class.php
Implements to Send Message.
background_process_is_finished in ./background_process.module
Implements to Check if the background process has finished.
background_process_is_started in ./background_process.module
Implements to Check if the background process has started.
DefaultController::backgroundBatchOverviewPage in background_batch/src/Controller/DefaultController.php
Implements Background Batch Overview Page.

... See full list

File

progress/progress.module, line 99
Progress framework for keeping track of progresses. @todo Force MyISAM for table {progress} to avoid transaction/isolation level problems, and use INSERT DELAYED for performance.

Code

function progress_get_progress($name) {
  $result = db_query("SELECT name, progress, message, start_stamp, end_stamp, current_stamp FROM {progress} WHERE name = :name", [
    ':name' => $name,
  ])
    ->fetchObject();
  if ($result) {
    $result->start = $result->start_stamp;
    $result->end = $result->end_stamp;
    $result->current = $result->current_stamp;
  }
  return $result;
}