ActionScheduler_DBLogger::get_logs()publicWC 1.0

Retrieve an action's log entries from the database.

Method of the class: ActionScheduler_DBLogger{}

No Hooks.

Return

ActionScheduler_LogEntry[].

Usage

$ActionScheduler_DBLogger = new ActionScheduler_DBLogger();
$ActionScheduler_DBLogger->get_logs( $action_id );
$action_id(int) (required)
Action ID.

ActionScheduler_DBLogger::get_logs() code WC 8.7.0

public function get_logs( $action_id ) {
	/** @var \wpdb $wpdb */ //phpcs:ignore Generic.Commenting.DocComment.MissingShort
	global $wpdb;

	$records = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->actionscheduler_logs} WHERE action_id=%d", $action_id ) );

	return array_map( array( $this, 'create_entry_from_db_record' ), $records );
}