WC_Object_Data_Store_Interface
in
WC Data Store Interface
Tags
Table of Contents
- add_meta() : int
- Add new piece of meta.
- create() : mixed
- Method to create a new record of a WC_Data based object.
- delete() : bool
- Deletes a record from the database.
- delete_meta() : array<string|int, mixed>
- Deletes meta based on meta ID.
- read() : mixed
- Method to read a record. Creates a new WC_Data based object.
- read_meta() : array<string|int, mixed>
- Returns an array of meta for an object.
- update() : mixed
- Updates a record in the database.
- update_meta() : mixed
- Update meta.
Methods
add_meta()
Add new piece of meta.
public
add_meta(WC_Data &$data, object $meta) : int
Parameters
- $data : WC_Data
-
Data object.
- $meta : object
-
Meta object (containing ->key and ->value).
Return values
int — meta IDcreate()
Method to create a new record of a WC_Data based object.
public
create(WC_Data &$data) : mixed
Parameters
- $data : WC_Data
-
Data object.
Return values
mixed —delete()
Deletes a record from the database.
public
delete(WC_Data &$data[, array<string|int, mixed> $args = array() ]) : bool
Parameters
- $data : WC_Data
-
Data object.
- $args : array<string|int, mixed> = array()
-
Array of args to pass to the delete method.
Return values
bool — resultdelete_meta()
Deletes meta based on meta ID.
public
delete_meta(WC_Data &$data, object $meta) : array<string|int, mixed>
Parameters
- $data : WC_Data
-
Data object.
- $meta : object
-
Meta object (containing at least ->id).
Return values
array<string|int, mixed> —read()
Method to read a record. Creates a new WC_Data based object.
public
read(WC_Data &$data) : mixed
Parameters
- $data : WC_Data
-
Data object.
Return values
mixed —read_meta()
Returns an array of meta for an object.
public
read_meta(WC_Data &$data) : array<string|int, mixed>
Parameters
- $data : WC_Data
-
Data object.
Return values
array<string|int, mixed> —update()
Updates a record in the database.
public
update(WC_Data &$data) : mixed
Parameters
- $data : WC_Data
-
Data object.
Return values
mixed —update_meta()
Update meta.
public
update_meta(WC_Data &$data, object $meta) : mixed
Parameters
- $data : WC_Data
-
Data object.
- $meta : object
-
Meta object (containing ->id, ->key and ->value).