PHP Class WC_Customer_Download_Data_Store

Author: WooThemes
Inheritance: implements WC_Customer_Download_Data_Store_Interface
Show file Open project: woocommerce/woocommerce

Public Methods

Method Description
create ( WC_Customer_Download &$download ) Create dowload permission for a user.
delete ( WC_Customer_Download &$download, array $args = [] ) Method to delete a download permission from the database.
delete_by_download_id ( integer $id ) Method to delete a download permission from the database by download ID.
delete_by_id ( integer $id ) Method to delete a download permission from the database by ID.
delete_by_order_id ( integer $id ) Method to delete a download permission from the database by order ID.
get_downloads ( array $args = [] ) : array Get array of download ids by specified args.
get_downloads_for_customer ( integer $customer_id ) : array Get a customers downloads.
read ( &$download ) Method to read a download permission from the database.
update ( WC_Customer_Download &$download ) Method to update a download in the database.
update_download_id ( integer $product_id, string $old_id, string $new_id ) Update download ids if the hash changes.
update_user_by_order_id ( integer $order_id, integer $customer_id, string $email ) Update user prop for downloads based on order id.

Private Methods

Method Description
get_download ( array $data ) : WC_Customer_Download Get a download object.

Method Details

create() public method

Create dowload permission for a user.
public create ( WC_Customer_Download &$download )
$download WC_Customer_Download

delete() public method

Method to delete a download permission from the database.
public delete ( WC_Customer_Download &$download, array $args = [] )
$download WC_Customer_Download
$args array Array of args to pass to the delete method.

delete_by_download_id() public method

Method to delete a download permission from the database by download ID.

delete_by_id() public method

Method to delete a download permission from the database by ID.
public delete_by_id ( integer $id )
$id integer

delete_by_order_id() public method

Method to delete a download permission from the database by order ID.
public delete_by_order_id ( integer $id )
$id integer

get_downloads() public method

Get array of download ids by specified args.
public get_downloads ( array $args = [] ) : array
$args array
return array

get_downloads_for_customer() public method

Get a customers downloads.
public get_downloads_for_customer ( integer $customer_id ) : array
$customer_id integer
return array

read() public method

Method to read a download permission from the database.
public read ( &$download )

update() public method

Method to update a download in the database.
public update ( WC_Customer_Download &$download )
$download WC_Customer_Download

update_download_id() public method

Update download ids if the hash changes.
public update_download_id ( integer $product_id, string $old_id, string $new_id )
$product_id integer
$old_id string
$new_id string

update_user_by_order_id() public method

Update user prop for downloads based on order id.
public update_user_by_order_id ( integer $order_id, integer $customer_id, string $email )
$order_id integer
$customer_id integer
$email string