WC_Customer_Download::__construct()
Constructor.
Method of the class: WC_Customer_Download{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Customer_Download = new WC_Customer_Download(); $WC_Customer_Download->__construct( $download );
- $download(int|object|array)
- Download ID, instance or data.
WC_Customer_Download::__construct() WC Customer Download:: construct code WC 9.4.2
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 ); } }