ActionScheduler_DBStore::make_action_from_db_record
Create an action from a database record.
Method of the class: ActionScheduler_DBStore{}
No Hooks.
Returns
ActionScheduler_Action|ActionScheduler_CanceledAction|ActionScheduler_FinishedAction.
Usage
// protected - for code of main (parent) or child class $result = $this->make_action_from_db_record( $data );
- $data(object) (required)
- Action database record.
ActionScheduler_DBStore::make_action_from_db_record() ActionScheduler DBStore::make action from db record code WC 10.3.6
protected function make_action_from_db_record( $data ) {
$hook = $data->hook;
$args = json_decode( $data->args, true );
$schedule = unserialize( $data->schedule ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize
$this->validate_args( $args, $data->action_id );
$this->validate_schedule( $schedule, $data->action_id );
if ( empty( $schedule ) ) {
$schedule = new ActionScheduler_NullSchedule();
}
$group = $data->group ? $data->group : '';
return ActionScheduler::factory()->get_stored_action( $data->status, $data->hook, $args, $schedule, $group, $data->priority );
}