Méthode | Description | |
---|---|---|
__construct ( ) | Get things started | |
add_meta ( integer $customer_id, string $meta_key = '', mixed $meta_value, boolean $unique = false ) : boolean | Add meta data field to a customer. | |
create_table ( ) | Create the table | |
delete_meta ( integer $customer_id, string $meta_key = '', mixed $meta_value = '' ) : boolean | Remove metadata matching criteria from a customer. | |
get_columns ( ) | Get table columns and data types | |
get_meta ( integer $customer_id, string $meta_key = '', boolean $single = false ) : mixed | Retrieve customer meta field for a customer. | |
register_table ( ) | Register the table with $wpdb so the metadata api can find it | |
update_meta ( integer $customer_id, string $meta_key = '', mixed $meta_value, mixed $prev_value = '' ) : boolean | Update customer meta field based on Customer ID. |
Méthode | Description | |
---|---|---|
sanitize_customer_id ( integer | stripe $customer_id ) : integer | boolean | Given a customer ID, make sure it's a positive number, greater than zero before inserting or adding. |
public add_meta ( integer $customer_id, string $meta_key = '', mixed $meta_value, boolean $unique = false ) : boolean | ||
$customer_id | integer | Customer ID. |
$meta_key | string | Metadata name. |
$meta_value | mixed | Metadata value. |
$unique | boolean | Optional, default is false. Whether the same key should not be added. |
Résultat | boolean | False for failure. True for success. |
public get_meta ( integer $customer_id, string $meta_key = '', boolean $single = false ) : mixed | ||
$customer_id | integer | Customer ID. |
$meta_key | string | The meta key to retrieve. |
$single | boolean | Whether to return a single value. |
Résultat | mixed | Will be an array if $single is false. Will be value of meta data field if $single is true. |
public register_table ( ) |
public update_meta ( integer $customer_id, string $meta_key = '', mixed $meta_value, mixed $prev_value = '' ) : boolean | ||
$customer_id | integer | Customer ID. |
$meta_key | string | Metadata key. |
$meta_value | mixed | Metadata value. |
$prev_value | mixed | Optional. Previous value to check before removing. |
Résultat | boolean | False on failure, true if success. |