You are here

function progress_get_progresses in Progress 7

Same name and namespace in other branches
  1. 8 progress.module \progress_get_progresses()
  2. 6 progress.module \progress_get_progresses()

Get all progresses

Return value

array Array of objects containing all progress data

File

./progress.module, line 188
Progress framework for keeping track of progresses

Code

function progress_get_progresses() {
  $result = db_select('progress', 'p')
    ->fields('p', array(
    'name',
    'progress',
    'message',
    'start_stamp',
    'end_stamp',
    'current_stamp',
  ))
    ->execute();
  $progresses = array();
  foreach ($result as $progress) {
    $progress->start = $progress->start_stamp;
    $progress->end = $progress->end_stamp;
    $progress->current = $progress->current_stamp;
    $progresses[$progress->name] = $progress;
  }
  return $progresses;
}