PHP Class WC_Product_Variation_Data_Store_CPT

Author: WooThemes
Inheritance: extends WC_Product_Data_Store_CPT, implements WC_Object_Data_Store_Interface
Show file Open project: woocommerce/woocommerce

Public Methods

Method Description
create ( &$product ) Create a new product.
read ( &$product ) Reads a product from the database and sets its data to the class.
update ( &$product ) Updates an existing product.
update_post_meta ( &$product ) Helper method that updates all the post meta for a product based on it's settings in the WC_Product class.

Protected Methods

Method Description
exclude_internal_meta_keys ( object $meta ) : boolean Callback to remove unwanted meta data.
read_product_data ( &$product ) Read post data.
update_attributes ( &$product ) Update attribute meta values.
update_terms ( &$product ) For all stored terms in all taxonomies, save them to the DB.
update_version_and_type ( &$product ) Make sure we store the product version (to track data changes).

Method Details

create() public method

Create a new product.
Since: 2.7.0
public create ( &$product )

exclude_internal_meta_keys() protected method

Callback to remove unwanted meta data.
protected exclude_internal_meta_keys ( object $meta ) : boolean
$meta object
return boolean false if excluded.

read() public method

Reads a product from the database and sets its data to the class.
Since: 2.7.0
public read ( &$product )

read_product_data() protected method

Read post data.
Since: 2.7.0
protected read_product_data ( &$product )

update() public method

Updates an existing product.
Since: 2.7.0
public update ( &$product )

update_attributes() protected method

Update attribute meta values.
Since: 2.7.0
protected update_attributes ( &$product )

update_post_meta() public method

Helper method that updates all the post meta for a product based on it's settings in the WC_Product class.
Since: 2.7.0
public update_post_meta ( &$product )

update_terms() protected method

For all stored terms in all taxonomies, save them to the DB.
Since: 2.7.0
protected update_terms ( &$product )

update_version_and_type() protected method

Make sure we store the product version (to track data changes).
Since: 2.7.0
protected update_version_and_type ( &$product )