CronExpression::getMultipleRunDates
Get multiple run dates starting at the current date or a specific date
Метод класса: CronExpression{}
Хуков нет.
Возвращает
array. Returns an array of run dates
Использование
$CronExpression = new CronExpression(); $CronExpression->getMultipleRunDates( $total, $currentTime, $invert, $allowCurrentDate );
- $total(int) (обязательный)
- Set the total number of dates to calculate.
- $currentTime(строка|DateTime)
- (optional) Relative calculation date.
По умолчанию:'now' - $invert(true|false)
- (optional) Set to TRUE to retrieve previous dates.
По умолчанию:false - $allowCurrentDate(true|false)
- (optional) Set to TRUE to return the
php current date if it matches the cron expression .
По умолчанию:false
Код CronExpression::getMultipleRunDates() CronExpression::getMultipleRunDates WC 11.3.0
public function getMultipleRunDates($total, $currentTime = 'now', $invert = false, $allowCurrentDate = false)
{
$matches = array();
for ($i = 0; $i < max(0, $total); $i++) {
$matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDate);
}
return $matches;
}