class-wc-abstract-order-data-store-interface.php
8 years ago
class-wc-coupon-data-store-interface.php
8 years ago
class-wc-customer-data-store-interface.php
8 years ago
class-wc-customer-download-data-store-interface.php
8 years ago
class-wc-customer-download-log-data-store-interface.php
8 years ago
class-wc-importer-interface.php
8 years ago
class-wc-log-handler-interface.php
8 years ago
class-wc-logger-interface.php
8 years ago
class-wc-object-data-store-interface.php
8 years ago
class-wc-order-data-store-interface.php
8 years ago
class-wc-order-item-data-store-interface.php
8 years ago
class-wc-order-item-product-data-store-interface.php
8 years ago
class-wc-order-item-type-data-store-interface.php
8 years ago
class-wc-order-refund-data-store-interface.php
8 years ago
class-wc-payment-token-data-store-interface.php
8 years ago
class-wc-product-data-store-interface.php
8 years ago
class-wc-product-variable-data-store-interface.php
8 years ago
class-wc-queue-interface.php
7 years ago
class-wc-shipping-zone-data-store-interface.php
8 years ago
class-wc-webhooks-data-store-interface.php
7 years ago
class-wc-object-data-store-interface.php
83 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Object Data Store Interface |
| 4 | * |
| 5 | * @version 3.0.0 |
| 6 | * @package WooCommerce/Interface |
| 7 | */ |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | /** |
| 14 | * WC Data Store Interface |
| 15 | * |
| 16 | * @version 3.0.0 |
| 17 | */ |
| 18 | interface WC_Object_Data_Store_Interface { |
| 19 | /** |
| 20 | * Method to create a new record of a WC_Data based object. |
| 21 | * |
| 22 | * @param WC_Data $data Data object. |
| 23 | */ |
| 24 | public function create( &$data ); |
| 25 | |
| 26 | /** |
| 27 | * Method to read a record. Creates a new WC_Data based object. |
| 28 | * |
| 29 | * @param WC_Data $data Data object. |
| 30 | */ |
| 31 | public function read( &$data ); |
| 32 | |
| 33 | /** |
| 34 | * Updates a record in the database. |
| 35 | * |
| 36 | * @param WC_Data $data Data object. |
| 37 | */ |
| 38 | public function update( &$data ); |
| 39 | |
| 40 | /** |
| 41 | * Deletes a record from the database. |
| 42 | * |
| 43 | * @param WC_Data $data Data object. |
| 44 | * @param array $args Array of args to pass to the delete method. |
| 45 | * @return bool result |
| 46 | */ |
| 47 | public function delete( &$data, $args = array() ); |
| 48 | |
| 49 | /** |
| 50 | * Returns an array of meta for an object. |
| 51 | * |
| 52 | * @param WC_Data $data Data object. |
| 53 | * @return array |
| 54 | */ |
| 55 | public function read_meta( &$data ); |
| 56 | |
| 57 | /** |
| 58 | * Deletes meta based on meta ID. |
| 59 | * |
| 60 | * @param WC_Data $data Data object. |
| 61 | * @param object $meta Meta object (containing at least ->id). |
| 62 | * @return array |
| 63 | */ |
| 64 | public function delete_meta( &$data, $meta ); |
| 65 | |
| 66 | /** |
| 67 | * Add new piece of meta. |
| 68 | * |
| 69 | * @param WC_Data $data Data object. |
| 70 | * @param object $meta Meta object (containing ->key and ->value). |
| 71 | * @return int meta ID |
| 72 | */ |
| 73 | public function add_meta( &$data, $meta ); |
| 74 | |
| 75 | /** |
| 76 | * Update meta. |
| 77 | * |
| 78 | * @param WC_Data $data Data object. |
| 79 | * @param object $meta Meta object (containing ->id, ->key and ->value). |
| 80 | */ |
| 81 | public function update_meta( &$data, $meta ); |
| 82 | } |
| 83 |