\Action_Scheduler\MigrationScheduler

Class Scheduler

Summary

Methods
Properties
Constants
hook()
unhook()
run_migration()
mark_complete()
is_migration_scheduled()
schedule_migration()
unschedule_migration()
No public properties found
HOOK
GROUP
No protected methods found
No protected properties found
N/A
get_schedule_interval()
get_batch_size()
get_migration_runner()
No private properties found
N/A

Constants

HOOK

HOOK = 'action_scheduler/migration_hook'

Migration action hook.

GROUP

GROUP = 'action-scheduler-migration'

Migration action group.

Methods

hook()

hook() : mixed

Set up the callback for the scheduled job.

Returns

mixed

unhook()

unhook() : mixed

Remove the callback for the scheduled job.

Returns

mixed

run_migration()

run_migration() : mixed

The migration callback.

Returns

mixed

mark_complete()

mark_complete() : mixed

Mark the migration complete.

Returns

mixed

is_migration_scheduled()

is_migration_scheduled() : bool

Get a flag indicating whether the migration is scheduled.

Returns

bool —

Whether there is a pending action in the store to handle the migration

schedule_migration()

schedule_migration(int  $when) : string

Schedule the migration.

Parameters

int $when

Optional timestamp to run the next migration batch. Defaults to now.

Returns

string —

The action ID

unschedule_migration()

unschedule_migration() : mixed

Remove the scheduled migration action.

Returns

mixed

get_schedule_interval()

get_schedule_interval() : int

Get migration batch schedule interval.

Returns

int —

Seconds between migration runs. Defaults to 0 seconds to allow chaining migration via Async Runners.

get_batch_size()

get_batch_size() : int

Get migration batch size.

Returns

int —

Number of actions to migrate in each batch. Defaults to 250.

get_migration_runner()

get_migration_runner() : \Action_Scheduler\Migration\Runner

Get migration runner object.

Returns

\Action_Scheduler\Migration\Runner