class-wc-customer-download-data-store-interface.php 1.42 KB
Newer Older
imac's avatar
imac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * WC Customer Download Data Store Interface.
 *
 * @version  3.0.0
 * @category Interface
 * @author   WooThemes
 */
interface WC_Customer_Download_Data_Store_Interface {

	/**
	 * Method to delete a download permission from the database by ID.
	 *
	 * @param int $id
	 */
	public function delete_by_id( $id );

	/**
	 * Method to delete a download permission from the database by order ID.
	 *
	 * @param int $id
	 */
	public function delete_by_order_id( $id );

	/**
	 * Method to delete a download permission from the database by download ID.
	 *
	 * @param int $id
	 */
	public function delete_by_download_id( $id );

	/**
	 * Get array of download ids by specified args.
	 *
	 * @param  array $args
	 * @return array of WC_Customer_Download
	 */
	public function get_downloads( $args = array() );

	/**
	 * Update download ids if the hash changes.
	 *
	 * @param  int $product_id
	 * @param  string $old_id
	 * @param  string $new_id
	 */
	public function update_download_id( $product_id, $old_id, $new_id );

	/**
	 * Get a customers downloads.
	 *
	 * @param  int $customer_id
	 * @return array
	 */
	public function get_downloads_for_customer( $customer_id );

	/**
	 * Update user prop for downloads based on order id.
	 *
	 * @param  int $order_id
	 * @param  int $customer_id
	 * @param  string $email
	 */
	public function update_user_by_order_id( $order_id, $customer_id, $email );
}