WC_Customer_Download_Data_Store::create_from_data()publicWC 1.0

Create download permission for a user, from an array of data.

Method of the class: WC_Customer_Download_Data_Store{}

Return

null. Nothing (null).

Usage

$WC_Customer_Download_Data_Store = new WC_Customer_Download_Data_Store();
$WC_Customer_Download_Data_Store->create_from_data( $data );
$data(array) (required)
Data to create the permission for.

WC_Customer_Download_Data_Store::create_from_data() code WC 9.4.2

public function create_from_data( $data ) {
	$data = array_intersect_key( $data, array_flip( self::DOWNLOAD_PERMISSION_DB_FIELDS ) );

	$id = $this->insert_new_download_permission( $data );

	do_action( 'woocommerce_grant_product_download_access', $data );

	return $id;
}