You are here

public static function BackgroundProcess::load in Background Process 7.2

Same name and namespace in other branches
  1. 8 background_process.class.php \BackgroundProcess::load()
  2. 6 BackgroundProcess.class.php \BackgroundProcess::load()
  3. 7 BackgroundProcess.class.php \BackgroundProcess::load()

Load BackgroundProcess from the DB.

Parameters

$pid: Process ID

$reset (optional): Bypass static cache

Return value

BackgroundProcess

5 calls to BackgroundProcess::load()
background_process_cron_queue_worker in ./background_process.module
background_process_load in ./background_process.module
Load a background process
background_process_service_access in ./background_process.module
Access handler for service call
background_process_service_start in ./background_process.module
Call the function requested by the service call
drush_background_process_execute in ./background_process.drush.inc

File

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

Class

BackgroundProcess
@file

Code

public static function load($pid, $reset = FALSE) {

  // Ensure DB availability
  if ($reset || !isset(self::$processes['pid'][$pid])) {
    drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
    $result = db_select('background_process', 'bp', array(
      'target' => 'background_process',
    ))
      ->fields('bp')
      ->condition('bp.pid', $pid)
      ->execute()
      ->fetchObject();
    return $result ? self::create($result) : NULL;
  }
  return self::$processes['pid'][$pid];
}