2016-11-18 14:07:21 +00:00
|
|
|
<?php
|
2018-03-06 08:17:25 +00:00
|
|
|
/**
|
|
|
|
* Customer Download Data Store Interface
|
|
|
|
*
|
|
|
|
* @version 3.0.0
|
2020-08-05 16:36:24 +00:00
|
|
|
* @package WooCommerce\Interface
|
2018-03-06 08:17:25 +00:00
|
|
|
*/
|
|
|
|
|
2016-11-18 14:07:21 +00:00
|
|
|
/**
|
|
|
|
* WC Customer Download Data Store Interface.
|
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @version 3.0.0
|
2016-11-18 14:07:21 +00:00
|
|
|
*/
|
|
|
|
interface WC_Customer_Download_Data_Store_Interface {
|
2016-11-18 19:29:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method to delete a download permission from the database by ID.
|
|
|
|
*
|
2018-03-06 08:17:25 +00:00
|
|
|
* @param int $id Download Permission ID.
|
2016-11-18 19:29:37 +00:00
|
|
|
*/
|
|
|
|
public function delete_by_id( $id );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method to delete a download permission from the database by order ID.
|
|
|
|
*
|
2018-03-06 08:17:25 +00:00
|
|
|
* @param int $id Order ID.
|
2016-11-18 19:29:37 +00:00
|
|
|
*/
|
|
|
|
public function delete_by_order_id( $id );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method to delete a download permission from the database by download ID.
|
|
|
|
*
|
2018-03-06 08:17:25 +00:00
|
|
|
* @param int $id Download ID.
|
2016-11-18 19:29:37 +00:00
|
|
|
*/
|
|
|
|
public function delete_by_download_id( $id );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get array of download ids by specified args.
|
|
|
|
*
|
2018-03-06 08:17:25 +00:00
|
|
|
* @param array $args Arguments.
|
2016-11-18 19:29:37 +00:00
|
|
|
* @return array of WC_Customer_Download
|
|
|
|
*/
|
|
|
|
public function get_downloads( $args = array() );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update download ids if the hash changes.
|
|
|
|
*
|
2018-03-06 08:17:25 +00:00
|
|
|
* @param int $product_id Product ID.
|
|
|
|
* @param string $old_id Old ID.
|
|
|
|
* @param string $new_id New ID.
|
2016-11-18 19:29:37 +00:00
|
|
|
*/
|
|
|
|
public function update_download_id( $product_id, $old_id, $new_id );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a customers downloads.
|
|
|
|
*
|
2018-03-06 08:17:25 +00:00
|
|
|
* @param int $customer_id Customer ID.
|
2016-11-18 19:29:37 +00:00
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function get_downloads_for_customer( $customer_id );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update user prop for downloads based on order id.
|
|
|
|
*
|
2018-03-06 08:17:25 +00:00
|
|
|
* @param int $order_id Order ID.
|
|
|
|
* @param int $customer_id Customer ID.
|
|
|
|
* @param string $email Email Address.
|
2016-11-18 19:29:37 +00:00
|
|
|
*/
|
|
|
|
public function update_user_by_order_id( $order_id, $customer_id, $email );
|
2016-11-18 14:07:21 +00:00
|
|
|
}
|