ActionScheduler_DBStore::make_action_from_db_record()protectedWC 1.0

Create an action from a database record.

Метод класса: ActionScheduler_DBStore{}

Хуков нет.

Возвращает

ActionScheduler_Action|ActionScheduler_CanceledAction|ActionScheduler_FinishedAction.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->make_action_from_db_record( $data );
$data(объект) (обязательный)
Action database record.

Код ActionScheduler_DBStore::make_action_from_db_record() WC 9.3.3

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 );
}