\ActionScheduler_SimpleSchedule

Class ActionScheduler_SimpleSchedule

Summary

Methods
Properties
Constants
__construct()
is_recurring()
calculate_next()
get_next()
get_date()
__sleep()
__wakeup()
next()
No public properties found
No constants found
No protected methods found
$scheduled_timestamp
N/A
No private methods found
$scheduled_date
$timestamp
N/A

Properties

$scheduled_timestamp

$scheduled_timestamp : int

Timestamp equivalent of @see $this->scheduled_date

Type

normal

$scheduled_date

$scheduled_date : \DateTime

The date & time the schedule is set to run.

Type

\DateTime

$timestamp

$timestamp : null|\DateTime

Deprecated property @see $this->__wakeup() for details.

Type

normal

Methods

__construct()

__construct(\DateTime  $date) : mixed

Construct.

Parameters

\DateTime $date

The date & time to run the action.

Returns

mixed

is_recurring()

is_recurring() : bool

Schedule is not recurring.

Returns

bool

calculate_next()

calculate_next(\DateTime  $after) : \DateTime|null

Calculate when this schedule should start after a given date & time using the number of seconds between recurrences.

Parameters

\DateTime $after

Timestamp.

Returns

\DateTime|null

get_next()

get_next(\DateTime  $after) : \DateTime|null

Get the next date & time when this schedule should run after a given date & time.

Parameters

\DateTime $after

Start timestamp.

Returns

\DateTime|null

get_date()

get_date() : \DateTime|null

Get the date & time the schedule is set to run.

Returns

\DateTime|null

__sleep()

__sleep() : array

Serialize schedule with data required prior to AS 3.0.0

Prior to Action Scheduler 3.0.0, schedules used different property names to refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0 aligned properties and property names for better inheritance. To guard against the scheduled date for single actions always being seen as "now" if downgrading to Action Scheduler < 3.0.0, we need to also store the data with the old property names so if it's unserialized in AS < 3.0, the schedule doesn't end up with a null recurrence.

Returns

array

__wakeup()

__wakeup() : mixed

Unserialize recurring schedules serialized/stored prior to AS 3.0.0

Prior to Action Scheduler 3.0.0, schedules used different property names to refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0 aligned properties and property names for better inheritance. To maintain backward compatibility with schedules serialized and stored prior to 3.0, we need to correctly map the old property names with matching visibility.

Returns

mixed

next()

next(\DateTime  $after = null) : \DateTime|null

Get the date & time this schedule was created to run, or calculate when it should be run after a given date & time.

Parameters

\DateTime $after

DateTime to calculate against.

Returns

\DateTime|null