You are here

function webform_scheduled_tasks_do_actions in Webform Scheduled Tasks 8

Function that does the actions, must also be triggerable by a drush command.

2 calls to webform_scheduled_tasks_do_actions()
cqc_webform_scheduled_tasks_cron in ./webform_scheduled_tasks.module
This method makes sure we only fire at a set frequency.
drush_webform_scheduled_tasks in ./webform_scheduled_tasks.drush.inc
Method to run the various drush commands depending on the arguments supplied.
1 string reference to 'webform_scheduled_tasks_do_actions'
WebformSanitizeConfigForm::buildForm in src/Form/WebformSanitizeConfigForm.php

File

./webform_scheduled_tasks.module, line 26
This hook will fire whenever cron fires, usually 20 mins.

Code

function webform_scheduled_tasks_do_actions($from_drush = FALSE) {
  $field = webform_scheduled_tasks_get_config('field_name');
  $date = date('Y-m-d H:i:s');
  if (strlen($field) > 1) {
    sanitize_webform_field($field);
    webform_scheduled_tasks_set_config('last_run', $date);
  }
  if ($from_drush) {
    return $date;
  }
}