WC_Customer_Download_Log::__construct( int|object|array $download_log )
Constructor.
Description Description
Parameters Parameters
- $download_log
-
(Required) Download log ID.
Source Source
File: includes/class-wc-customer-download-log.php
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 ); } }