PHP Class Abstract_WC_Order_Item_Type_Data_Store

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

Protected Properties

Property Type Description
$meta_type WP defines 'post', 'user', 'comment', and 'term'.
$object_id_field_for_meta string This should be the name of the field your table uses for associating meta with objects. For example, in payment_tokenmeta, this would be payment_token_id.

Public Methods

Method Description
create ( WC_Order_Item &$item ) Create a new order item in the database.
delete ( WC_Order_Item &$item, array $args = [] ) Remove an order item from the database.
read ( WC_Order_Item &$item ) Read a order item from the database.
save_item_data ( WC_Order_Item &$item ) Saves an item's data to the database / item meta.
update ( WC_Order_Item &$item ) Update a order item in the database.

Method Details

create() public method

Create a new order item in the database.
Since: 2.7.0
public create ( WC_Order_Item &$item )
$item WC_Order_Item

delete() public method

Remove an order item from the database.
Since: 2.7.0
public delete ( WC_Order_Item &$item, array $args = [] )
$item WC_Order_Item
$args array Array of args to pass to the delete method.

read() public method

Read a order item from the database.
Since: 2.7.0
public read ( WC_Order_Item &$item )
$item WC_Order_Item

save_item_data() public method

Ran after both create and update, so $item->get_id() will be set.
Since: 2.7.0
public save_item_data ( WC_Order_Item &$item )
$item WC_Order_Item

update() public method

Update a order item in the database.
Since: 2.7.0
public update ( WC_Order_Item &$item )
$item WC_Order_Item

Property Details

$meta_type protected property

WP defines 'post', 'user', 'comment', and 'term'.
protected $meta_type

$object_id_field_for_meta protected property

This should be the name of the field your table uses for associating meta with objects. For example, in payment_tokenmeta, this would be payment_token_id.
protected string $object_id_field_for_meta
return string