\ActionScheduler_NullSchedule

Class ActionScheduler_NullSchedule

Summary

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

Properties

$scheduled_date

$scheduled_date : \DateTime|null

DateTime instance.

Type

normal

$scheduled_timestamp

$scheduled_timestamp : int

Timestamp equivalent of @see $this->scheduled_date

Type

normal

$timestamp

$timestamp : null|\DateTime

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

Type

normal

Methods

is_recurring()

is_recurring() : bool

Check if a schedule should recur.

Returns

bool

__sleep()

__sleep() : array

This schedule has no scheduled DateTime, so we need to override the parent __sleep().

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

Wakeup.

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

__construct()

__construct(null|\DateTime  $date = null) : mixed

Make the $date param optional and default to null.

Parameters

null|\DateTime $date

The date & time to run the action.

Returns

mixed

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

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

calculate_next()

calculate_next(\DateTime  $after) : \DateTime

Calculate when the next instance of this schedule would run based on a given date & time.

Parameters

\DateTime $after

Start timestamp.

Returns

\DateTime