Piwik\Scheduler\Schedule\
Weekly class is used to schedule tasks every week.
The class defines the following methods:
setHour()
ash; Sets the hour of the day on which the task should be executed. Inherited from Schedule
factory()
ash; Returns a new Schedule instance using a string description of the scheduled period type and a string description of the day within the period to execute the task on. Inherited from Schedule
setHour()
Sets the hour of the day on which the task should be executed.
$hour
(int
) —
Must be >= 0
and < 24
.Exception
— If the current scheduled period is hourly or if $hour
is invalid.factory()
Returns a new Schedule instance using a string description of the scheduled period type and a string description of the day within the period to execute the task on.
It accepts the following parameter(s):
$periodType
(string
) —
The scheduled period type. Can be 'hourly'
, 'daily'
, 'weekly'
, or 'monthly'
.$periodDay
(bool
|false
|int
|string
) —
A string describing the day within the scheduled period to execute the task on. Only valid for week and month periods. If 'weekly'
is supplied for $periodType
, this should be a day of the week, for example, 'monday'
or 'tuesday'
. If 'monthly'
is supplied for $periodType
, this can be a numeric day in the month or a day in one week of the month. For example, 12
, 23
, 'first sunday'
or 'fourth tuesday'
.It throws one of the following exceptions: