Piwik\Scheduler\
Describes a task that should be executed on a given time.
See the TaskScheduler docs to learn more about scheduled tasks.
The class defines the following methods:
__construct()
getObjectInstance()
— Returns the object instance that contains the method to execute.getClassName()
— Returns the name of the class that contains the method to execute.getMethodName()
— Returns the name of the method that will be executed.getMethodParameter()
— Returns the value that will be passed to the method when executed, or null
if no value will be supplied.getScheduledTime()
— Returns a Schedule instance that describes when the method should be executed and how long before the next execution.getRescheduledTime()
— Returns the time in milliseconds when this task will be executed next.getPriority()
— Returns the task priority.getTTL()
— Returns the TTL for this task.getName()
— Returns a unique name for this scheduled task.__construct()
$objectInstance
(mixed
) —
The object or class that contains the method to execute regularly. Usually this will be a Plugin instance.$methodName
(string
) —
The name of the method that will be regularly executed.$methodParameter
(mixed
|null
) —
An optional parameter to pass to the method when executed. Must be convertible to string.$scheduledTime
(Schedule
|null
) —
A Schedule instance that describes when the method should be executed and how long before the next execution.$priority
(int
) —
The priority of the task. Tasks with a higher priority will be executed first. Tasks with low priority will be executed last.$ttlInSeconds
(int
|null
) —
TTL to use for this task. Defauts to 3600. See self::$ttlInSecondsgetObjectInstance()
Returns the object instance that contains the method to execute. Returns a class name if the method is static.
mixed
value.getClassName()
Returns the name of the class that contains the method to execute.
string
value.getMethodName()
Returns the name of the method that will be executed.
string
value.getMethodParameter()
Returns the value that will be passed to the method when executed, or null
if
no value will be supplied.
string
|null
—getScheduledTime()
Returns a Schedule instance that describes when the method should be executed and how long before the next execution.
Schedule
value.getRescheduledTime()
Returns the time in milliseconds when this task will be executed next.
int
value.getPriority()
Returns the task priority. The priority will be an integer whose value is between HIGH_PRIORITY and LOW_PRIORITY.
int
value.getTTL()
Returns the TTL for this task.
See self::$ttlInSeconds
int
value.getName()
Returns a unique name for this scheduled task. The name is stored in the DB and is used to store a task's previous execution time. The name is created using:
string
value.