PHP Класс WC_Payment_Token_Data_Store

Автор: WooThemes
Наследование: extends WC_Data_Store_WP, implements WC_Payment_Token_Data_Store_Interface, implements WC_Object_Data_Store_Interface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$meta_type string Meta type. Payment tokens are a new object type.

Открытые методы

Метод Описание
create ( WC_Payment_Token &$token ) Create a new payment token in the database.
delete ( WC_Payment_Token &$token, boolean $force_delete = false ) Remove a payment token from the database.
get_metadata ( id $token_id ) : array Returns metadata for a specific payment token.
get_token_by_id ( id $token_id ) : object Returns an stdObject of a token.
get_token_type_by_id ( id $token_id ) : string Get a token's type by ID.
get_tokens ( array $args ) : array Returns an array of objects (stdObject) matching specific token critera.
get_users_default_token ( id $user_id ) : object Returns an stdObject of a token for a user's default token.
read ( WC_Payment_Token &$token ) Read a token from the database.
set_default_status ( id $token_id, $status = true ) : string Update's a tokens default status in the database. Used for quickly looping through tokens and setting their statuses instead of creating a bunch of objects.
update ( WC_Payment_Token &$token ) Update a payment token.

Описание методов

create() публичный Метод

Create a new payment token in the database.
С версии: 2.7.0
public create ( WC_Payment_Token &$token )
$token WC_Payment_Token

delete() публичный Метод

Remove a payment token from the database.
С версии: 2.7.0
public delete ( WC_Payment_Token &$token, boolean $force_delete = false )
$token WC_Payment_Token
$force_delete boolean

get_metadata() публичный Метод

Returns metadata for a specific payment token.
С версии: 2.7.0
public get_metadata ( id $token_id ) : array
$token_id id
Результат array

get_token_by_id() публичный Метод

Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
С версии: 2.7.0
public get_token_by_id ( id $token_id ) : object
$token_id id
Результат object

get_token_type_by_id() публичный Метод

Get a token's type by ID.
С версии: 2.7.0
public get_token_type_by_id ( id $token_id ) : string
$token_id id
Результат string

get_tokens() публичный Метод

Accepts token_id, user_id, gateway_id, and type. Each object should contain the fields token_id, gateway_id, token, user_id, type, is_default.
С версии: 2.7.0
public get_tokens ( array $args ) : array
$args array
Результат array

get_users_default_token() публичный Метод

Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
С версии: 2.7.0
public get_users_default_token ( id $user_id ) : object
$user_id id
Результат object

read() публичный Метод

Read a token from the database.
С версии: 2.7.0
public read ( WC_Payment_Token &$token )
$token WC_Payment_Token

set_default_status() публичный Метод

Update's a tokens default status in the database. Used for quickly looping through tokens and setting their statuses instead of creating a bunch of objects.
С версии: 2.7.0
public set_default_status ( id $token_id, $status = true ) : string
$token_id id
Результат string

update() публичный Метод

Update a payment token.
С версии: 2.7.0
public update ( WC_Payment_Token &$token )
$token WC_Payment_Token

Описание свойств

$meta_type защищенное свойство

Meta type. Payment tokens are a new object type.
protected string $meta_type
Результат string