WC_Customer_Download_Log_Data_Store::update()publicWC 1.0

Method to update a download log in the database.

Method of the class: WC_Customer_Download_Log_Data_Store{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Customer_Download_Log_Data_Store = new WC_Customer_Download_Log_Data_Store();
$WC_Customer_Download_Log_Data_Store->update( $download_log );
$download_log(WC_Customer_Download_Log) (required) (passed by reference — &)
Download log object.

WC_Customer_Download_Log_Data_Store::update() code WC 9.4.2

public function update( &$download_log ) {
	global $wpdb;

	$data = array(
		'timestamp'       => date( 'Y-m-d H:i:s', $download_log->get_timestamp( 'edit' )->getTimestamp() ),
		'permission_id'   => $download_log->get_permission_id( 'edit' ),
		'user_id'         => $download_log->get_user_id( 'edit' ),
		'user_ip_address' => $download_log->get_user_ip_address( 'edit' ),
	);

	$format = array(
		'%s',
		'%s',
		'%s',
		'%s',
	);

	$wpdb->update(
		$wpdb->prefix . self::get_table_name(),
		$data,
		array(
			'download_log_id' => $download_log->get_id(),
		),
		$format
	);
	$download_log->apply_changes();
}