ActionScheduler_DBLogger::create_entry_from_db_record()privateWC 1.0

Create an action log entry from a database record.

Method of the class: ActionScheduler_DBLogger{}

No Hooks.

Return

ActionScheduler_LogEntry.

Usage

// private - for code of main (parent) class only
$result = $this->create_entry_from_db_record( $record );
$record(object) (required)
Log entry database record object.

ActionScheduler_DBLogger::create_entry_from_db_record() code WC 7.3.0

private function create_entry_from_db_record( $record ) {
	if ( empty( $record ) ) {
		return new ActionScheduler_NullLogEntry();
	}

	if ( is_null( $record->log_date_gmt ) ) {
		$date = as_get_datetime_object( ActionScheduler_StoreSchema::DEFAULT_DATE );
	} else {
		$date = as_get_datetime_object( $record->log_date_gmt );
	}

	return new ActionScheduler_LogEntry( $record->action_id, $record->message, $date );
}