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
파일 보기 프로젝트 열기: woocommerce/woocommerce

보호된 프로퍼티들

프로퍼티 타입 설명
$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