Documentation

CalendarSpec
in package
uses CloneWith

FinalYes

CalendarSpec describes an event specification relative to the calendar, similar to a traditional cron specification, but with labeled fields.

Each field can be one of:

  • *: matches always
  • x: matches when the field equals x
  • x/y: matches when the field equals x+n*y where n is an integer
  • x-z: matches when the field is between x and z inclusive
  • w,x,y,...: matches when the field is one of the listed values Each x, y, z, ... is either a decimal integer, or a month or day of week name or abbreviation (in the appropriate fields). A timestamp matches if all fields match. Note that fields have different default values, for convenience. Note that the special case that some cron implementations have for treating dayOfMonth and dayOfWeek as "or" instead of "and" when both are set is not implemented. dayOfWeek can accept 0 or 7 as Sunday CalendarSpec gets compiled into StructuredCalendarSpec, which is what will be returned if you describe the schedule.
Tags
see
CalendarSpec

Table of Contents

Properties

$comment  : string
$dayOfMonth  : string
$dayOfWeek  : string
$hour  : string
$minute  : string
$month  : string
$second  : string
$year  : string

Methods

new()  : self
withComment()  : self
withDayOfMonth()  : self
withDayOfWeek()  : self
withHour()  : self
withMinute()  : self
withMonth()  : self
withSecond()  : self
withYear()  : self
__construct()  : mixed

Properties

Methods

new()

public static new([string $second = '*' ][, string $minute = '*' ][, string $hour = '*' ][, string $dayOfMonth = '*' ][, string $month = '*' ][, string $year = '*' ][, string $dayOfWeek = '*' ][, string $comment = '' ]) : self
Parameters
$second : string = '*'

Expression to match seconds.

$minute : string = '*'

Expression to match minutes.

$hour : string = '*'

Expression to match hours.

$dayOfMonth : string = '*'

Expression to match days of the month.

$month : string = '*'

Expression to match months.

$year : string = '*'

Expression to match years.

$dayOfWeek : string = '*'

Expression to match days of the week.

$comment : string = ''

Free-form comment describing the intention of this spec.

Return values
self

withComment()

public withComment(string $comment) : self
Parameters
$comment : string
Return values
self

withDayOfMonth()

public withDayOfMonth(string|int $dayOfMonth) : self
Parameters
$dayOfMonth : string|int
Return values
self

withDayOfWeek()

public withDayOfWeek(string|int $dayOfWeek) : self
Parameters
$dayOfWeek : string|int
Return values
self

withHour()

public withHour(string|int $hour) : self
Parameters
$hour : string|int
Return values
self

withMinute()

public withMinute(string|int $minute) : self
Parameters
$minute : string|int
Return values
self

withMonth()

public withMonth(string|int $month) : self
Parameters
$month : string|int
Return values
self

withSecond()

public withSecond(string|int $second) : self
Parameters
$second : string|int
Return values
self

withYear()

public withYear(string|int $year) : self
Parameters
$year : string|int
Return values
self

__construct()

private __construct(string $second, string $minute, string $hour, string $dayOfMonth, string $month, string $year, string $dayOfWeek, string $comment) : mixed
Parameters
$second : string

Expression to match seconds.

$minute : string

Expression to match minutes.

$hour : string

Expression to match hours.

$dayOfMonth : string

Expression to match days of the month.

$month : string

Expression to match months.

$year : string

Expression to match years.

$dayOfWeek : string

Expression to match days of the week.

$comment : string

Free-form comment describing the intention of this spec.


        
On this page

Search results