WC_Customer_Download_Log::__construct()
Constructor.
Method of the class: WC_Customer_Download_Log{}
No Hooks.
Return
null
. Nothing (null).
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.
WC_Customer_Download_Log::__construct() WC Customer Download Log:: construct code WC 9.7.1
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 ); } }