PHP Class WC_Data_Store

Since: 2.7.0
Author: WooThemes
Show file Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
__call ( $method, $parameters ) Data stores can define additional functions (for example, coupons have some helper methods for increasing or decreasing usage). This passes through to the instance if that function exists.
__construct ( string $object_type ) Tells WC_Data_Store which object (coupon, product, order, etc) store we want to work with.
create ( &$data ) Create an object in the data store.
delete ( &$data, array $args = [] ) Delete an object from the data store.
get_current_class_name ( ) : string Returns the class name of the current data store.
load ( string $object_type ) Loads a data store for us or returns null if an invalid store.
read ( &$data ) Reads an object from the data store.
update ( &$data ) Update an object in the data store.

Method Details

__call() public method

Data stores can define additional functions (for example, coupons have some helper methods for increasing or decreasing usage). This passes through to the instance if that function exists.
Since: 2.7.0
public __call ( $method, $parameters )
$method
$parameters

__construct() public method

Tells WC_Data_Store which object (coupon, product, order, etc) store we want to work with.
public __construct ( string $object_type )
$object_type string Name of object.

create() public method

Create an object in the data store.
Since: 2.7.0
public create ( &$data )

delete() public method

Delete an object from the data store.
Since: 2.7.0
public delete ( &$data, array $args = [] )
$args array Array of args to pass to the delete method.

get_current_class_name() public method

Returns the class name of the current data store.
Since: 2.7.0
public get_current_class_name ( ) : string
return string

load() public static method

Loads a data store for us or returns null if an invalid store.
Since: 2.7.0
public static load ( string $object_type )
$object_type string Name of object.

read() public method

Reads an object from the data store.
Since: 2.7.0
public read ( &$data )

update() public method

Update an object in the data store.
Since: 2.7.0
public update ( &$data )