PHP Класс WC_Data_Store_WP

Contains functions like meta handling for all default data stores. Your own data store doesn't need to use WC_Data_Store_WP -- you can write your own meta handling functions.
Автор: WooThemes
Показать файл Открыть проект

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

Свойство Тип Описание
$internal_meta_keys array Data stored in meta keys, but not considered "meta" for an object.
$meta_type WP defines 'post', 'user', 'comment', and 'term'.
$object_id_field_for_meta string This should be the name of the field your table uses for associating meta with objects. For example, in payment_tokenmeta, this would be payment_token_id.

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

Метод Описание
add_meta ( &$object, $meta ) : meta Add new piece of meta.
delete_meta ( &$object, $meta ) : array Deletes meta based on meta ID.
read_meta ( &$object ) : array Returns an array of meta for an object.
update_meta ( &$object, $meta ) Update meta.

Защищенные методы

Метод Описание
exclude_internal_meta_keys ( object $meta ) : boolean Callback to remove unwanted meta data.
get_db_info ( ) : array Table structure is slightly different between meta types, this function will return what we need to know.
get_term_ids ( $object, string $taxonomy ) : array Get and store terms from a taxonomy.
prefix_key ( $key ) : array Internal meta keys we don't want exposed as part of meta_data. This is in addition to all data props with _ prefix.

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

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

Add new piece of meta.
С версии: 2.7.0
public add_meta ( &$object, $meta ) : meta
Результат meta ID

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

Deletes meta based on meta ID.
С версии: 2.7.0
public delete_meta ( &$object, $meta ) : array
Результат array

exclude_internal_meta_keys() защищенный Метод

Callback to remove unwanted meta data.
protected exclude_internal_meta_keys ( object $meta ) : boolean
$meta object
Результат boolean

get_db_info() защищенный Метод

Table structure is slightly different between meta types, this function will return what we need to know.
С версии: 2.7.0
protected get_db_info ( ) : array
Результат array Array elements: table, object_id_field, meta_id_field

get_term_ids() защищенный Метод

Get and store terms from a taxonomy.
С версии: 2.7.0
protected get_term_ids ( $object, string $taxonomy ) : array
$taxonomy string Taxonomy name e.g. product_cat
Результат array of terms

prefix_key() защищенный Метод

Internal meta keys we don't want exposed as part of meta_data. This is in addition to all data props with _ prefix.
С версии: 2.6.0
protected prefix_key ( $key ) : array
Результат array

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

Returns an array of meta for an object.
С версии: 2.7.0
public read_meta ( &$object ) : array
Результат array

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

Update meta.
С версии: 2.7.0
public update_meta ( &$object, $meta )

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

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

Data stored in meta keys, but not considered "meta" for an object.
С версии: 2.7.0
protected array $internal_meta_keys
Результат array

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

WP defines 'post', 'user', 'comment', and 'term'.
protected $meta_type

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

This should be the name of the field your table uses for associating meta with objects. For example, in payment_tokenmeta, this would be payment_token_id.
protected string $object_id_field_for_meta
Результат string