PHP 클래스 Give_DB_Customer_Meta, Give

상속: extends Give_DB
파일 보기 프로젝트 열기: wordimpress/give

공개 메소드들

메소드 설명
__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.

비공개 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

Get things started
부터: 1.6
public __construct ( )

add_meta() 공개 메소드

For internal use only. Use Give_Customer->add_meta() for public usage.
부터: 1.6
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.
리턴 boolean False for failure. True for success.

create_table() 공개 메소드

Create the table
부터: 1.6
public create_table ( )

delete_meta() 공개 메소드

For internal use only. Use Give_Customer->delete_meta() for public usage. You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate metadata with the same key. It also allows removing all metadata matching key, if needed.
부터: 1.6
public delete_meta ( integer $customer_id, string $meta_key = '', mixed $meta_value = '' ) : boolean
$customer_id integer Customer ID.
$meta_key string Metadata name.
$meta_value mixed Optional. Metadata value.
리턴 boolean False for failure. True for success.

get_columns() 공개 메소드

Get table columns and data types
부터: 1.6
public get_columns ( )

get_meta() 공개 메소드

For internal use only. Use Give_Customer->get_meta() for public usage.
부터: 1.6
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.
리턴 mixed Will be an array if $single is false. Will be value of meta data field if $single is true.

register_table() 공개 메소드

Register the table with $wpdb so the metadata api can find it
부터: 1.6
public register_table ( )

update_meta() 공개 메소드

For internal use only. Use Give_Customer->update_meta() for public usage. Use the $prev_value parameter to differentiate between meta fields with the same key and Customer ID. If the meta field for the customer does not exist, it will be added.
부터: 1.6
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.
리턴 boolean False on failure, true if success.