class-wc-abstract-order-data-store-interface.php
4 years ago
class-wc-coupon-data-store-interface.php
4 years ago
class-wc-customer-data-store-interface.php
4 years ago
class-wc-customer-download-data-store-interface.php
4 years ago
class-wc-customer-download-log-data-store-interface.php
4 years ago
class-wc-importer-interface.php
4 years ago
class-wc-log-handler-interface.php
4 years ago
class-wc-logger-interface.php
4 years ago
class-wc-object-data-store-interface.php
4 years ago
class-wc-order-data-store-interface.php
4 years ago
class-wc-order-item-data-store-interface.php
4 years ago
class-wc-order-item-product-data-store-interface.php
4 years ago
class-wc-order-item-type-data-store-interface.php
4 years ago
class-wc-order-refund-data-store-interface.php
4 years ago
class-wc-payment-token-data-store-interface.php
4 years ago
class-wc-product-data-store-interface.php
4 years ago
class-wc-product-variable-data-store-interface.php
4 years ago
class-wc-queue-interface.php
4 years ago
class-wc-shipping-zone-data-store-interface.php
4 years ago
class-wc-webhooks-data-store-interface.php
4 years ago
class-wc-order-item-data-store-interface.php
103 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Order Item Data Store Interface |
| 4 | * |
| 5 | * @version 3.0.0 |
| 6 | * @package WooCommerce\Interface |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * WC Order Item Data Store Interface |
| 11 | * |
| 12 | * Functions that must be defined by the order item data store (for functions). |
| 13 | * |
| 14 | * @version 3.0.0 |
| 15 | */ |
| 16 | interface WC_Order_Item_Data_Store_Interface { |
| 17 | |
| 18 | /** |
| 19 | * Add an order item to an order. |
| 20 | * |
| 21 | * @param int $order_id Order ID. |
| 22 | * @param array $item order_item_name and order_item_type. |
| 23 | * @return int Order Item ID |
| 24 | */ |
| 25 | public function add_order_item( $order_id, $item ); |
| 26 | |
| 27 | /** |
| 28 | * Update an order item. |
| 29 | * |
| 30 | * @param int $item_id Item ID. |
| 31 | * @param array $item order_item_name or order_item_type. |
| 32 | * @return boolean |
| 33 | */ |
| 34 | public function update_order_item( $item_id, $item ); |
| 35 | |
| 36 | /** |
| 37 | * Delete an order item. |
| 38 | * |
| 39 | * @param int $item_id Item ID. |
| 40 | */ |
| 41 | public function delete_order_item( $item_id ); |
| 42 | |
| 43 | /** |
| 44 | * Update term meta. |
| 45 | * |
| 46 | * @param int $item_id Item ID. |
| 47 | * @param string $meta_key Meta key. |
| 48 | * @param mixed $meta_value Meta value. |
| 49 | * @param string $prev_value Previous value (default: ''). |
| 50 | * @return bool |
| 51 | */ |
| 52 | public function update_metadata( $item_id, $meta_key, $meta_value, $prev_value = '' ); |
| 53 | |
| 54 | /** |
| 55 | * Add term meta. |
| 56 | * |
| 57 | * @param int $item_id Item ID. |
| 58 | * @param string $meta_key Meta key. |
| 59 | * @param mixed $meta_value Meta value. |
| 60 | * @param bool $unique Unique? (default: false). |
| 61 | * @return int New row ID or 0 |
| 62 | */ |
| 63 | public function add_metadata( $item_id, $meta_key, $meta_value, $unique = false ); |
| 64 | |
| 65 | |
| 66 | /** |
| 67 | * Delete term meta. |
| 68 | * |
| 69 | * @param int $item_id Item ID. |
| 70 | * @param string $meta_key Meta key. |
| 71 | * @param string $meta_value Meta value (default: ''). |
| 72 | * @param bool $delete_all Delete all matching entries? (default: false). |
| 73 | * @return bool |
| 74 | */ |
| 75 | public function delete_metadata( $item_id, $meta_key, $meta_value = '', $delete_all = false ); |
| 76 | |
| 77 | /** |
| 78 | * Get term meta. |
| 79 | * |
| 80 | * @param int $item_id Item ID. |
| 81 | * @param string $key Meta key. |
| 82 | * @param bool $single Store as single value and not serialised (default: true). |
| 83 | * @return mixed |
| 84 | */ |
| 85 | public function get_metadata( $item_id, $key, $single = true ); |
| 86 | |
| 87 | /** |
| 88 | * Get order ID by order item ID. |
| 89 | * |
| 90 | * @param int $item_id Item ID. |
| 91 | * @return int |
| 92 | */ |
| 93 | public function get_order_id_by_order_item_id( $item_id ); |
| 94 | |
| 95 | /** |
| 96 | * Get the order item type based on Item ID. |
| 97 | * |
| 98 | * @param int $item_id Item ID. |
| 99 | * @return string |
| 100 | */ |
| 101 | public function get_order_item_type( $item_id ); |
| 102 | } |
| 103 |