You are here

public static function BackgroundProcess::loadAll in Background Process 7.2

Load all BackgroundProcess from the DB.

Parameters

optional $status: Status

Return value

array BackgroundProcess objects

2 calls to BackgroundProcess::loadAll()
background_process_ass_auto_unlock in background_process_ass/background_process_ass.module
Unlock locked processes that aren't really running.
background_process_overview_page in ./background_process.admin.inc
Overview of background processes.

File

./background_process.inc, line 178
External API short overview

Class

BackgroundProcess
@file

Code

public static function loadAll($status = NULL) {

  // Ensure DB availability
  drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
  $result = db_select('background_process', 'bp', array(
    'target' => 'background_process',
  ))
    ->fields('bp');
  if (isset($status)) {
    $result = $result
      ->condition('bp.exec_status', $status);
  }
  $result = $result
    ->execute();
  $processes = array();
  while ($process = $result
    ->fetchObject()) {
    $processes[] = BackgroundProcess::create($process);
  }
  return $processes;
}