You are here

function _ultimate_cron_job_load_all_raw in Ultimate Cron 7.2

Load all jobs available from cTools export.

This function loads the raw job "entities", and is NOT the function exposed to cTools export and export ui.

Parameters

bool $reset: Reset the object cache.

Return value

array UltimateCronJob objects.

2 calls to _ultimate_cron_job_load_all_raw()
ultimate_cron_ultimate_cron_job_list in ./ultimate_cron.module
Only overriden jobs should be exportable.
_ultimate_cron_job_load_all in ./ultimate_cron.module
CTools Export load all callback.

File

./ultimate_cron.module, line 333

Code

function _ultimate_cron_job_load_all_raw($reset = FALSE) {
  ctools_include('export');
  $table = 'ultimate_cron_job';
  if ($reset) {
    ctools_export_load_object_reset($table);
  }
  $class = _ultimate_cron_get_class('job');
  $results = ctools_export_load_object($table);
  foreach ($results as $name => &$result) {
    $result->disabled = ultimate_cron_job_get_status($name);
    $result->settings = !empty($result->settings) ? $result->settings : array();

    // Make sure the object is of the correcty type.
    if (!$result instanceof $class) {
      $result = $class::factory($result);
    }
  }
  return $results;
}