protected function RngCron::deleteScheduleRules in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/RngCron.php \Drupal\rng\RngCron::deleteScheduleRules()
- 3.x src/RngCron.php \Drupal\rng\RngCron::deleteScheduleRules()
Delete scheduled rules which have had too many attempts.
1 call to RngCron::deleteScheduleRules()
- RngCron::hook_cron in src/
RngCron.php - React to Drupal `hook_cron` hooks.
File
- src/
RngCron.php, line 83
Class
- RngCron
- RNG Cron.
Namespace
Drupal\rngCode
protected function deleteScheduleRules() {
$ids = $this->ruleSchedulerStorage
->getQuery()
->condition('attempts', RuleSchedule::ATTEMPTS_MAX, '>')
->execute();
/** @var \Drupal\rng\RuleScheduleInterface[] $rule_schedules */
$rule_schedules = $this->ruleSchedulerStorage
->loadMultiple($ids);
$this->ruleSchedulerStorage
->delete($rule_schedules);
}