class-wc-abstract-order-data-store-interface.php
5 years ago
class-wc-coupon-data-store-interface.php
5 years ago
class-wc-customer-data-store-interface.php
5 years ago
class-wc-customer-download-data-store-interface.php
5 years ago
class-wc-customer-download-log-data-store-interface.php
5 years ago
class-wc-importer-interface.php
5 years ago
class-wc-log-handler-interface.php
5 years ago
class-wc-logger-interface.php
5 years ago
class-wc-object-data-store-interface.php
5 years ago
class-wc-order-data-store-interface.php
1 year ago
class-wc-order-item-data-store-interface.php
3 years ago
class-wc-order-item-product-data-store-interface.php
5 years ago
class-wc-order-item-type-data-store-interface.php
5 years ago
class-wc-order-refund-data-store-interface.php
5 years ago
class-wc-payment-token-data-store-interface.php
5 years ago
class-wc-product-data-store-interface.php
1 year ago
class-wc-product-variable-data-store-interface.php
5 years ago
class-wc-queue-interface.php
4 months ago
class-wc-shipping-zone-data-store-interface.php
4 years ago
class-wc-webhooks-data-store-interface.php
5 years ago
class-wc-coupon-data-store-interface.php
59 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Coupon Data Store Interface |
| 4 | * |
| 5 | * @version 3.0.0 |
| 6 | * @package WooCommerce\Interfaces |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * WC Coupon Data Store Interface |
| 11 | * |
| 12 | * Functions that must be defined by coupon store classes. |
| 13 | * |
| 14 | * @version 3.0.0 |
| 15 | */ |
| 16 | interface WC_Coupon_Data_Store_Interface { |
| 17 | /** |
| 18 | * Increase usage count for current coupon. |
| 19 | * |
| 20 | * @param WC_Coupon $coupon Coupon object. |
| 21 | * @param string $used_by Either user ID or billing email. |
| 22 | */ |
| 23 | public function increase_usage_count( &$coupon, $used_by = '' ); |
| 24 | |
| 25 | /** |
| 26 | * Decrease usage count for current coupon. |
| 27 | * |
| 28 | * @param WC_Coupon $coupon Coupon object. |
| 29 | * @param string $used_by Either user ID or billing email. |
| 30 | */ |
| 31 | public function decrease_usage_count( &$coupon, $used_by = '' ); |
| 32 | |
| 33 | /** |
| 34 | * Get the number of uses for a coupon by user ID. |
| 35 | * |
| 36 | * @param WC_Coupon $coupon Coupon object. |
| 37 | * @param int $user_id User ID. |
| 38 | * @return int |
| 39 | */ |
| 40 | public function get_usage_by_user_id( &$coupon, $user_id ); |
| 41 | |
| 42 | /** |
| 43 | * Return a coupon code for a specific ID. |
| 44 | * |
| 45 | * @param int $id Coupon ID. |
| 46 | * @return string Coupon Code. |
| 47 | */ |
| 48 | public function get_code_by_id( $id ); |
| 49 | |
| 50 | /** |
| 51 | * Return an array of IDs for for a specific coupon code. |
| 52 | * Can return multiple to check for existence. |
| 53 | * |
| 54 | * @param string $code Coupon code. |
| 55 | * @return array Array of IDs. |
| 56 | */ |
| 57 | public function get_ids_by_code( $code ); |
| 58 | } |
| 59 |