PHP 클래스 Give_DB_Customers, Give

부터: 1.0
상속: extends Give_DB
파일 보기 프로젝트 열기: wordimpress/give 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ) Class Constructor
add ( array $data = [] ) : int/bool Add a customer
attach_payment ( integer $customer_id, integer $payment_id ) : boolean Attaches a payment ID to a customer
count ( array $args = [] ) : integer Count the total number of customers in the database
create_table ( ) : void Create the table
decrement_stats ( integer $customer_id, float $amount ) : boolean Decrements customer purchase stats
delete ( boolean | string | integer $_id_or_email = false ) : boolean | integer Delete a customer
exists ( string $value = '', string $field = 'email' ) : boolean Checks if a customer exists
get_column_defaults ( ) : array Get default column values
get_columns ( ) : array Get columns and formats
get_customer_by ( string $field = 'id', mixed $value ) : mixed Retrieves a single customer from the database
get_customers ( array $args = [] ) : array | object | null Retrieve customers from the database
increment_stats ( integer $customer_id, float $amount ) : boolean Increments customer purchase stats
installed ( ) : boolean Check if the Customers table was ever installed
remove_payment ( integer $customer_id, integer $payment_id ) : boolean Removes a payment ID from a customer
update_customer_email_on_user_update ( integer $user_id, WP_User $old_user_data ) : boolean Updates the email address of a customer record when the email on a user is updated

메소드 상세

__construct() 공개 메소드

Set up the Give DB Customer Class.
부터: 1.0
public __construct ( )

add() 공개 메소드

Add a customer
부터: 1.0
public add ( array $data = [] ) : int/bool
$data array
리턴 int/bool

attach_payment() 공개 메소드

Attaches a payment ID to a customer
부터: 1.0
public attach_payment ( integer $customer_id, integer $payment_id ) : boolean
$customer_id integer Customer ID.
$payment_id integer Payment ID.
리턴 boolean

count() 공개 메소드

Count the total number of customers in the database
부터: 1.0
public count ( array $args = [] ) : integer
$args array
리턴 integer Total number of customers.

create_table() 공개 메소드

Create the table
부터: 1.0
public create_table ( ) : void
리턴 void

decrement_stats() 공개 메소드

Decrements customer purchase stats
부터: 1.0
public decrement_stats ( integer $customer_id, float $amount ) : boolean
$customer_id integer Customer ID.
$amount float Amount.
리턴 boolean

delete() 공개 메소드

NOTE: This should not be called directly as it does not make necessary changes to the payment meta and logs. Use give_customer_delete() instead.
부터: 1.0
public delete ( boolean | string | integer $_id_or_email = false ) : boolean | integer
$_id_or_email boolean | string | integer
리턴 boolean | integer

exists() 공개 메소드

Checks if a customer exists
부터: 1.0
public exists ( string $value = '', string $field = 'email' ) : boolean
$value string The value to search for. Default is empty.
$field string The Customer ID or email to search in. Default is 'email'.
리턴 boolean True is exists, false otherwise.

get_column_defaults() 공개 메소드

Get default column values
부터: 1.0
public get_column_defaults ( ) : array
리턴 array Default column values.

get_columns() 공개 메소드

Get columns and formats
부터: 1.0
public get_columns ( ) : array
리턴 array Columns and formats.

get_customer_by() 공개 메소드

Retrieves a single customer from the database
부터: 1.0
public get_customer_by ( string $field = 'id', mixed $value ) : mixed
$field string ID or email. Default is 'id'.
$value mixed The Customer ID or email to search. Default is 0.
리턴 mixed Upon success, an object of the customer. Upon failure, NULL

get_customers() 공개 메소드

Retrieve customers from the database
부터: 1.0
public get_customers ( array $args = [] ) : array | object | null
$args array
리턴 array | object | null Customers array or object. Null if not found.

increment_stats() 공개 메소드

Increments customer purchase stats
public increment_stats ( integer $customer_id, float $amount ) : boolean
$customer_id integer Customer ID.
$amount float Amoumt.
리턴 boolean

installed() 공개 메소드

Check if the Customers table was ever installed
부터: 1.4.3
public installed ( ) : boolean
리턴 boolean Returns if the customers table was installed and upgrade routine run.

remove_payment() 공개 메소드

Removes a payment ID from a customer
부터: 1.0
public remove_payment ( integer $customer_id, integer $payment_id ) : boolean
$customer_id integer Customer ID.
$payment_id integer Payment ID.
리턴 boolean

update_customer_email_on_user_update() 공개 메소드

Updates the email address of a customer record when the email on a user is updated
부터: 1.4.3
public update_customer_email_on_user_update ( integer $user_id, WP_User $old_user_data ) : boolean
$user_id integer User ID.
$old_user_data WP_User User data.
리턴 boolean