You are here

protected function JobSchedulerCronTab::checkDay in Job Scheduler 8.3

Same name and namespace in other branches
  1. 8.2 src/JobSchedulerCronTab.php \Drupal\job_scheduler\JobSchedulerCronTab::checkDay()

Checks whether date's day is a valid one.

Parameters

array $date: Date array with: 'mday', 'mon', 'year', 'hours', 'minutes'.

Return value

bool Returns true if the day is valid, false otherwise.

2 calls to JobSchedulerCronTab::checkDay()
JobSchedulerCronTab::nextDate in src/JobSchedulerCronTab.php
Finds the next occurrence within the next year as a date array.
JobSchedulerCronTab::nextDay in src/JobSchedulerCronTab.php
Finds the next day from date that matches with cron parameters.

File

src/JobSchedulerCronTab.php, line 174

Class

JobSchedulerCronTab
Class for job scheduler crontab.

Namespace

Drupal\job_scheduler

Code

protected function checkDay(array $date) {
  foreach ([
    'wday',
    'mday',
    'mon',
  ] as $key) {
    if (!in_array($date[$key], $this->cron[$key])) {
      return FALSE;
    }
  }
  return TRUE;
}