You are here

function workbench_scheduler_schedule_names in Workbench Scheduler 7

Same name and namespace in other branches
  1. 7.2 workbench_scheduler.module \workbench_scheduler_schedule_names()

Generate an array of schedule machine names.

Return value

array An array of schedule machine names.

2 calls to workbench_scheduler_schedule_names()
workbench_scheduler_handler_filter_name::get_value_options in includes/workbench_scheduler_handler_filter_name.inc
Return filter options for schedule machine names.
_workbench_schedule_check_machine_name_exists in ./workbench_scheduler.module
Returns the number of results for schedules with given machine name(s).

File

./workbench_scheduler.module, line 607
Content scheduling for Workbench.

Code

function workbench_scheduler_schedule_names() {
  $names =& drupal_static(__FUNCTION__);
  if (!isset($names)) {

    // Fetch list of all machine_names for schedules from the DB.
    $names = db_select('workbench_scheduler_schedules', 'wss')
      ->fields('wss', array(
      'name',
      'label',
    ))
      ->execute()
      ->fetchAllAssoc('name');

    // Simplify the assoc array.
    foreach ($names as &$name) {
      $name = $name->label;
    }
  }
  return $names;
}