WordPress at Your Fingertips
function is not described

WC_Customer_Download::__construct() public WC 1.0

Constructor.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Customer_Download = new WC_Customer_Download();
$WC_Customer_Download->__construct( $download );
$download(int|object|array)
Download ID, instance or data.

Code of WC_Customer_Download::__construct() WC 5.8.0

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

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

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

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