PHP Class Abstract_WC_Order_Data_Store_CPT

Author: WooThemes
Inheritance: extends WC_Data_Store_WP, implements WC_Object_Data_Store_Interface, implements WC_Abstract_Order_Data_Store_Interface
Show file Open project: woocommerce/woocommerce Class Usage Examples

Protected Properties

Property Type Description
$internal_meta_keys array Data stored in meta keys, but not considered "meta" for an order.
$meta_type string Internal meta type used to store order data.

Public Methods

Method Description
create ( WC_Order &$order ) Method to create a new order in the database.
delete ( &$order, array $args = [] ) Method to delete an order from the database.
delete_items ( $order, string $type = null ) Remove all line items (products, coupons, shipping, taxes) from the order.
get_payment_token_ids ( $order ) : array Get token ids for an order.
read ( &$order ) Method to read an order from the database.
read_items ( WC_Order $order, string $type ) : array Read order items of a specific type from the database for this order.
update ( WC_Order &$order ) Method to update an order in the database.
update_payment_token_ids ( $order, array $token_ids ) Update token ids for an order.

Protected Methods

Method Description
clear_caches ( &$order ) Clear any caches.
get_post_excerpt ( WC_order $order ) : string Excerpt for post.
get_post_title ( ) : string Get a title for the new post type.
read_order_data ( &$order, object $post_object ) Read order data. Can be overridden by child classes to load other props.
update_post_meta ( &$order ) Helper method that updates all the post meta for an order based on it's settings in the WC_Order class.

Method Details

clear_caches() protected method

Clear any caches.
Since: 2.7.0
protected clear_caches ( &$order )

create() public method

Method to create a new order in the database.
public create ( WC_Order &$order )
$order WC_Order

delete() public method

Method to delete an order from the database.
public delete ( &$order, array $args = [] )
$args array Array of args to pass to the delete method.

delete_items() public method

Remove all line items (products, coupons, shipping, taxes) from the order.
public delete_items ( $order, string $type = null )
$type string Order item type. Default null.

get_payment_token_ids() public method

Get token ids for an order.
public get_payment_token_ids ( $order ) : array
return array

get_post_excerpt() protected method

Excerpt for post.
protected get_post_excerpt ( WC_order $order ) : string
$order WC_order
return string

get_post_title() protected method

Get a title for the new post type.
protected get_post_title ( ) : string
return string

read() public method

Method to read an order from the database.
public read ( &$order )

read_items() public method

Read order items of a specific type from the database for this order.
public read_items ( WC_Order $order, string $type ) : array
$order WC_Order
$type string
return array

read_order_data() protected method

Read order data. Can be overridden by child classes to load other props.
Since: 2.7.0
protected read_order_data ( &$order, object $post_object )
$post_object object

update() public method

Method to update an order in the database.
public update ( WC_Order &$order )
$order WC_Order

update_payment_token_ids() public method

Update token ids for an order.
public update_payment_token_ids ( $order, array $token_ids )
$token_ids array

update_post_meta() protected method

Helper method that updates all the post meta for an order based on it's settings in the WC_Order class.
Since: 2.7.0
protected update_post_meta ( &$order )

Property Details

$internal_meta_keys protected property

Data stored in meta keys, but not considered "meta" for an order.
Since: 2.7.0
protected array $internal_meta_keys
return array

$meta_type protected property

Internal meta type used to store order data.
protected string $meta_type
return string