WordPress at Your Fingertips
function is not described

WC_Customer_Download_Log::__construct() public WC 1.0

Constructor.

{} It's a method of the class: WC_Customer_Download_Log{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Customer_Download_Log = new WC_Customer_Download_Log();
$WC_Customer_Download_Log->__construct( $download_log );
$download_log(int|object|array)
Download log ID.

Code of WC_Customer_Download_Log::__construct() WC 5.9.0

public function __construct( $download_log = 0 ) {
	parent::__construct( $download_log );

	if ( is_numeric( $download_log ) && $download_log > 0 ) {
		$this->set_id( $download_log );
	} elseif ( $download_log instanceof self ) {
		$this->set_id( $download_log->get_id() );
	} elseif ( is_object( $download_log ) && ! empty( $download_log->download_log_id ) ) {
		$this->set_id( $download_log->download_log_id );
		$this->set_props( (array) $download_log );
		$this->set_object_read( true );
	} else {
		$this->set_object_read( true );
	}

	$this->data_store = WC_Data_Store::load( 'customer-download-log' );

	if ( $this->get_id() > 0 ) {
		$this->data_store->read( $this );
	}
}