You are here

public static function BackgroundProcess::loadByHandle in Background Process 7.2

Load BackgroundProcess from the DB.

Parameters

$pid: Process ID

$reset (optional): Bypass static cache

Return value

BackgroundProcess

9 calls to BackgroundProcess::loadByHandle()
BackgroundBatchContext::getProcess in background_batch/background_batch.module
background_batch_overview_page in background_batch/background_batch.pages.inc
Overview of current and recent batch jobs.
background_process_get_process in ./background_process.module
Get background process
background_process_load in ./background_process.module
Load a background process
background_process_update_status in ./background_process.module
Update background process status

... See full list

File

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

Class

BackgroundProcess
@file

Code

public static function loadByHandle($handle, $reset = FALSE) {

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