ActionScheduler_DBLogger::get_logs()
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() ActionScheduler DBLogger::get logs code WC 9.7.1
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 ); }